8889841chome/clixcotz/tcchp.clix.co.tz/wp-content/plugins/mailpoet/assets/dist/js/form_editor.js000064400005476401150444254350025576 0ustar00/*! For license information please see form_editor.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([[514],{89504:function(e,t,n){e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},17121:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function l(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,l=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",l,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",l,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(s=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===s.resize&&(e.style.resize="horizontal"),t="content-box"===s.boxSizing?-(parseFloat(s.paddingTop)+parseFloat(s.paddingBottom)):parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),isNaN(t)&&(t=0),d()}var s;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},P=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},A=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(null!=e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),D=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class R extends v.Component{constructor(e){let{allowedTypes:t,gallery:n=!1,unstableFeaturedImageFlow:r=!1,modalClass:o,multiple:i=!1,title:l=(0,N.__)("Select or Upload Media")}=e;super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this);const{wp:a}=window;if(n)this.buildAndSetGalleryFrame();else{const e={title:l,multiple:i};t&&(e.library={type:t}),this.frame=a.media(e)}o&&this.frame.$el.addClass(o),r&&this.buildAndSetFeatureImageFrame(),this.initializeListeners()}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=B}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=P());const l=D(r),a=new o.media.model.Selection(l.models,{props:l.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:a,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,t=L(),n=D(this.props.value),r=new e.media.model.Selection(n.models,{props:n.props.toJSON()});this.frame=new t({mimeType:this.props.allowedTypes,state:"featured-image",multiple:this.props.multiple,selection:r,editing:!!this.props.value}),e.media.frame=this.frame}componentWillUnmount(){this.frame.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>A(e.toJSON()))):A(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?null!=t&&t.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=D(o);i.more().done((function(){var e;n&&null!=i&&null!==(e=i.models)&&void 0!==e&&e.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){this.props.gallery&&this.buildAndSetGalleryFrame(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}var M=R;const O={};function Z(e){const t=window.URL.createObjectURL(e);return O[t]=e,t}function F(e){O[e]&&window.URL.revokeObjectURL(e),delete O[e]}function j(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const z=()=>{};async function H(e){let{allowedTypes:t,additionalData:n={},filesList:r,maxUploadFileSize:o,onError:i=z,onFileChange:l,wpAllowedMimeTypes:a=null}=e;const s=[...r],c=[],u=(e,t)=>{var n;F(null===(n=c[e])||void 0===n?void 0:n.url),c[e]=t,l(c.filter(Boolean))},d=e=>!t||t.some((t=>t.includes("/")?t===e:e.startsWith(`${t}/`))),p=(m=a)?Object.entries(m).map((e=>{let[t,n]=e;const[r]=n.split("/");return[n,...t.split("|").map((e=>`${r}/${e}`))]})).flat():m;var m;const f=[];for(const e of s)p&&e.type&&(h=e.type,!p.includes(h))?i({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,N.sprintf)((0,N.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||d(e.type)?o&&e.size>o?i({code:"SIZE_ABOVE_LIMIT",message:(0,N.sprintf)((0,N.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?i({code:"EMPTY_FILE",message:(0,N.sprintf)((0,N.__)("%s: This file is empty."),e.name),file:e}):(f.push(e),c.push({url:Z(e)}),l(c)):i({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,N.sprintf)((0,N.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var h;for(let e=0;e{let[t,r]=e;return n.append(t,r)})),(0,y.default)({path:"/wp/v2/media",body:n,method:"POST"})}var W=n(64826),$=n(81433),U=n(61888),G=n(85799),q=n(46688),K=n(33780),Y=n(84217);const X="block-default",J=["attributes","supports","save","migrate","isEligible","apiVersion"],Q={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},filter:{value:["filter","duotone"],support:["color","__experimentalDuotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},ee={link:"a",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},te={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var ne=n(15680);const re={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]},oe={};function ie(e){return null!==e&&"object"==typeof e}function le(e){let{textdomain:t,...n}=e;const r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"],o=Object.fromEntries(Object.entries(n).filter((e=>{let[t]=e;return r.includes(t)})));return t&&Object.keys(re).forEach((e=>{o[e]&&(o[e]=se(re[e],o[e],t))})),o}function ae(e,t){const n=ie(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,$.select)(Xt).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');ie(e)&&function(e){for(const t of Object.keys(e))oe[t]?(void 0===oe[t].apiVersion&&e[t].apiVersion&&(oe[t].apiVersion=e[t].apiVersion),void 0===oe[t].ancestor&&e[t].ancestor&&(oe[t].ancestor=e[t].ancestor)):oe[t]=Object.fromEntries(Object.entries(e[t]).filter((e=>{let[,t]=e;return null!=t})).map((e=>{let[t,n]=e;return[(0,ne.eV)(t),n]})))}({[n]:le(e)});const r={name:n,icon:X,keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==oe?void 0:oe[n],...t};return(0,$.dispatch)(Xt).__experimentalRegisterBlockType(r),(0,$.select)(Xt).getBlockType(n)}function se(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,N._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>se(e[0],t,n))):ie(e)&&Object.entries(e).length&&ie(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=se(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function ce(){return(0,$.select)(Xt).getFreeformFallbackBlockName()}function ue(){return(0,$.select)(Xt).getUnregisteredFallbackBlockName()}function de(){return(0,$.select)(Xt).getDefaultBlockName()}function pe(e){var t;return null===(t=(0,$.select)(Xt))||void 0===t?void 0:t.getBlockType(e)}function me(){return(0,$.select)(Xt).getBlockTypes()}function fe(e,t,n){return(0,$.select)(Xt).getBlockSupport(e,t,n)}function he(e,t,n){return(0,$.select)(Xt).hasBlockSupport(e,t,n)}function ge(e){return"core/block"===(null==e?void 0:e.name)}function ve(e){return"core/template-part"===(null==e?void 0:e.name)}const be=(e,t)=>(0,$.select)(Xt).getBlockVariations(e,t);var ye=n(66711),_e=n(62925);function ke(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=je(e,t),o=(0,ye.Z)();return{clientId:o,name:e,isValid:!0,attributes:r,innerBlocks:n}}function xe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return ke(n,r,xe(o))}))}function we(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,ye.Z)(),o=je(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>we(e)))}}function Ce(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=(0,ye.Z)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>Ce(e)))}}const Ee=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!Se(e)&&r&&!e.isMultiBlock)return!1;if(!Se(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!Se(e)||!r&&"from"===t&&Ie(i.name)&&Ie(e.blockName)||!Le(e,n)||e.usingMobileTransformations&&Se(e)&&!Ie(i.name))},Se=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Ie=e=>e===(0,$.select)(Xt).getGroupingBlockName();function Te(e){if(!e.length)return[];const t=(e=>e.length?me().filter((t=>!!Ne(Be("from",t.name),(t=>Ee(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=pe(e[0].name);return(t?Be("to",t.name):[]).filter((t=>t&&Ee(t,"to",e))).map((e=>e.blocks)).flat().map((e=>"*"===e?e:pe(e)))})(e);return[...new Set([...t,...n])]}function Ne(e,t){const n=(0,_e.Hu)();for(let r=0;re||o),o.priority)}return n.applyFilters("transform",null)}function Be(e,t){if(void 0===t)return me().map((t=>{let{name:n}=t;return Be(e,n)})).flat();const n=Ze(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms);return(i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!Se(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e]).map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function Le(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function Pe(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,l=Be("from",t),a=Ne(Be("to",i),(e=>"block"===e.type&&-1!==e.blocks.indexOf(t)&&(!r||e.isMultiBlock)&&Le(e,n)))||Ne(l,(e=>"block"===e.type&&(Se(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&Le(e,n)));if(!a)return null;let s;return s=a.isMultiBlock?"__experimentalConvert"in a?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in a?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===s||"object"!=typeof s?null:(s=Array.isArray(s)?s:[s],s.some((e=>!pe(e.name)))?null:"*"===t?s:s.some((e=>e.name===t))?s.map(((t,n,r)=>(0,_e.O)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const Ae=(e,t)=>{var n;return ke(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>Ae(e.name,e))))};(0,G.l7)([q.Z,K.Z]);const De=["#191e23","#f8f9f9"];function Re(e){var t;Re[e.name]||(Re[e.name]=ke(e.name));const n=Re[e.name],r=pe(e.name);return Object.keys(null!==(t=null==r?void 0:r.attributes)&&void 0!==t?t:{}).every((t=>n.attributes[t]===e.attributes[t]))}function Me(e){return e.name===de()&&Re(e)}function Oe(e){return!!e&&("string"==typeof e||(0,v.isValidElement)(e)||"function"==typeof e||e instanceof v.Component)}function Ze(e){return"string"==typeof e?pe(e):e}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?(0,Y.Z)(i):o}function je(e,t){const n=pe(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,n)=>{let[r,o]=n;const i=t[r];return void 0!==i?e[r]=i:o.hasOwnProperty("default")&&(e[r]=o.default),-1!==["node","children"].indexOf(o.source)&&("string"==typeof e[r]?e[r]=[e[r]]:Array.isArray(e[r])||(e[r]=[])),e}),{})}function ze(e,t){return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.includes(n)})))}const He=[{slug:"text",title:(0,N.__)("Text")},{slug:"media",title:(0,N.__)("Media")},{slug:"design",title:(0,N.__)("Design")},{slug:"widgets",title:(0,N.__)("Widgets")},{slug:"theme",title:(0,N.__)("Theme")},{slug:"embed",title:(0,N.__)("Embeds")},{slug:"reusable",title:(0,N.__)("Reusable blocks")}];function Ve(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function We(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function $e(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const Ue=$e("SET_DEFAULT_BLOCK_NAME"),Ge=$e("SET_FREEFORM_FALLBACK_BLOCK_NAME"),qe=$e("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Ke=$e("SET_GROUPING_BLOCK_NAME");var Ye=(0,$.combineReducers)({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return ze(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Ve(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return ze(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,U.mapValues)(Ve(t.blockTypes),(t=>We([...(0,U.get)(t,["styles"],[]).map((e=>({...e,source:"block"}))),...(0,U.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))])))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:We([...(0,U.get)(e,[t.blockName],[]),...t.styles])};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(0,U.get)(e,[t.blockName],[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,U.mapValues)(Ve(t.blockTypes),(t=>We([...(0,U.get)(t,["variations"],[]).map((e=>({...e,source:"block"}))),...(0,U.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))])))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:We([...(0,U.get)(e,[t.blockName],[]),...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,U.get)(e,[t.blockName],[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:Ue,freeformFallbackBlockName:Ge,unregisteredFallbackBlockName:qe,groupingBlockName:Ke,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:He,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||(0,U.isEmpty)(t.category))return e;if(e.find((e=>{let{slug:n}=e;return n===t.slug})))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return ze(e,t.namespace)}return e}}),Xe=n(32407),Je=n(68457),Qe=n.n(Je),et=n(70845);const tt=(e,t)=>"string"==typeof t?ot(e,t):t;function nt(e){return e.unprocessedBlockTypes}const rt=(0,Xe.Z)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function ot(e,t){return e.blockTypes[t]}function it(e,t){return e.blockStyles[t]}const lt=(0,Xe.Z)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function at(e,t,n,r){const o=lt(e,t,r);return null==o?void 0:o.find((r=>{var o;if(Array.isArray(r.isActive)){const o=ot(e,t),i=Object.keys((null==o?void 0:o.attributes)||{}),l=r.isActive.filter((e=>i.includes(e)));return 0!==l.length&&l.every((e=>n[e]===r.attributes[e]))}return null===(o=r.isActive)||void 0===o?void 0:o.call(r,n,r.attributes)}))}function st(e,t,n){const r=lt(e,t,n),o=[...r].reverse().find((e=>{let{isDefault:t}=e;return!!t}));return o||r[0]}function ct(e){return e.categories}function ut(e){return e.collections}function dt(e){return e.defaultBlockName}function pt(e){return e.freeformFallbackBlockName}function mt(e){return e.unregisteredFallbackBlockName}function ft(e){return e.groupingBlockName}const ht=(0,Xe.Z)(((e,t)=>rt(e).filter((e=>{var n;return null===(n=e.parent)||void 0===n?void 0:n.includes(t)})).map((e=>{let{name:t}=e;return t}))),(e=>[e.blockTypes])),gt=(e,t,n,r)=>{const o=tt(e,t);return null!=o&&o.supports?(0,U.get)(o.supports,n,r):r};function vt(e,t,n,r){return!!gt(e,t,n,r)}function bt(e,t,n){var r;const o=tt(e,t),i=(0,et.Z)([e=>Qe()(null!=e?e:""),e=>e.toLowerCase(),e=>e.trim()]),l=i(n),a=(0,et.Z)([i,e=>e.includes(l)]);return a(o.title)||(null===(r=o.keywords)||void 0===r?void 0:r.some(a))||a(o.category)||"string"==typeof o.description&&a(o.description)}const yt=(e,t)=>ht(e,t).length>0,_t=(e,t)=>ht(e,t).some((t=>vt(e,t,"inserter",!0))),kt=(0,Xe.Z)(((e,t)=>{const n=ot(e,t);return!!n&&Object.entries(n.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))}),((e,t)=>{var n;return[null===(n=e.blockTypes[t])||void 0===n?void 0:n.attributes]})),xt=["background","backgroundColor","color","linkColor","buttonColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function wt(e,t,n){return e.filter((e=>!("fontSize"===e&&"heading"===n||"textDecoration"===e&&!t&&"link"!==n||"textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n))))}const Ct=(0,Xe.Z)(((e,t,n)=>{var r,o,i,l,a,s,c,u,d;if(!t)return wt(xt,t,n);const p=ot(e,t);if(!p)return[];const m=[];return null==p||null===(r=p.supports)||void 0===r||null===(o=r.spacing)||void 0===o||!o.blockGap||!0===(null==p||null===(i=p.supports)||void 0===i||null===(l=i.spacing)||void 0===l?void 0:l.__experimentalSkipSerialization)||null!=p&&null!==(a=p.supports)&&void 0!==a&&null!==(s=a.spacing)&&void 0!==s&&null!==(c=s.__experimentalSkipSerialization)&&void 0!==c&&null!==(u=c.some)&&void 0!==u&&u.call(c,(e=>"blockGap"===e))||m.push("blockGap"),null!=p&&null!==(d=p.supports)&&void 0!==d&&d.shadow&&m.push("shadow"),Object.keys(Q).forEach((e=>{Q[e].support&&(Q[e].requiresOptOut&&Q[e].support[0]in p.supports&&!1!==(0,U.get)(p.supports,Q[e].support)||(0,U.get)(p.supports,Q[e].support,!1))&&m.push(e)})),wt(m,t,n)}),((e,t)=>[e.blockTypes[t]]));var Et=n(85628),St=n(67492);const{error:It,warn:Tt}=window.console,Nt={common:"text",formatting:"text",layout:"design"};function Bt(e){return"function"==typeof e}const Lt=(e,t)=>{let{select:n}=t;const{name:r}=e,o=(0,_e.O)("blocks.registerBlockType",{...e},r,null);if(o.description&&"string"!=typeof o.description&&(0,St.default)("Declaring non-string block descriptions",{since:"6.2"}),o.deprecated&&(o.deprecated=o.deprecated.map((t=>Object.fromEntries(Object.entries((0,_e.O)("blocks.registerBlockType",{...ze(e,J),...t},r,t)).filter((e=>{let[t]=e;return J.includes(t)})))))),(0,Et.P)(o))if(Bt(o.save))if(!("edit"in o)||Bt(o.edit))if(Nt.hasOwnProperty(o.category)&&(o.category=Nt[o.category]),"category"in o&&!n.getCategories().some((e=>{let{slug:t}=e;return t===o.category}))&&(Tt('The block "'+r+'" is registered with an invalid category "'+o.category+'".'),delete o.category),"title"in o&&""!==o.title)if("string"==typeof o.title){if(o.icon=function(e){if(Oe(e=e||X))return{src:e};if("background"in e){const t=(0,G.Vi)(e.background),n=e=>t.contrast(e),r=Math.max(...De.map(n));return{...e,foreground:e.foreground?e.foreground:De.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(o.icon),Oe(o.icon.src))return o;It("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else It("Block titles must be strings.");else It('The block "'+r+'" must have a title.');else It('The "edit" property must be a valid function.');else It('The "save" property must be a valid function.');else It("Block settings must be a valid object.")};function Pt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}const At=e=>t=>{let{dispatch:n,select:r}=t;n({type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e});const o=Lt(e,{select:r});o&&n.addBlockTypes(o)},Dt=()=>e=>{let{dispatch:t,select:n}=e;const r=n.__experimentalGetUnprocessedBlockTypes(),o=Object.keys(r).reduce(((e,t)=>{const o=Lt(r[t],{select:n});return o&&e.push(o),e}),[]);o.length&&t.addBlockTypes(o)};function Rt(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Mt(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockName:e}}function Ot(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Zt(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Ft(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function jt(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function zt(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Ht(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Vt(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Wt(e){return{type:"SET_CATEGORIES",categories:e}}function $t(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Ut(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function Gt(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}var qt=n(86066);const{lock:Kt,unlock:Yt}=(0,qt.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/blocks"),Xt=(0,W.Z)("core/blocks",{reducer:Ye,selectors:r,actions:i});let Jt,Qt,en,tn;(0,$.register)(Xt),Yt(Xt).registerPrivateSelectors(o);const nn=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function rn(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function on(e){return rn(null,{},[],e,[e])}function ln(){const e=tn.length,t=function(){const e=nn.exec(Jt);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,l,,a]=e,s=n.length,c=!!r,u=!!a,d=(o||"core/")+i,p=!!l?function(e){try{return JSON.parse(e)}catch(e){return null}}(l):{};return u?["void-block",d,p,t,s]:c?["block-closer",d,null,t,s]:["block-opener",d,p,t,s]}(),[n,r,o,i,l]=t,a=i>Qt?Qt:null;switch(n){case"no-more-tokens":if(0===e)return an(),!1;if(1===e)return cn(),!1;for(;0)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");function dn(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(un);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:l=[]}=e;let a=0;const s=l.map((e=>null!==e?e:hn(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?wn(r,o,s):s}function gn(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,_e.O)("blocks.getBlockDefaultClassName",t,e)}function vn(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,_e.O)("blocks.getBlockMenuDefaultClassName",t,e)}const bn={},yn={};function _n(e,t,n){const r=Ze(e);return(0,mn.ZP)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const r=Ze(e);let{save:o}=r;if(o.prototype instanceof v.Component){const e=new o({attributes:t});o=e.render.bind(e)}bn.blockType=r,bn.attributes=t,yn.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,_e.H7)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,_e.O)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,fn.ZP)(e,i.props)||(i=(0,v.cloneElement)(i,e))}return(0,_e.O)("blocks.getSaveElement",i,r,t)}(r,t,n))}function kn(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,n)=>{let[r,o]=n;const i=t[r];return void 0===i||void 0!==o.source||"default"in o&&o.default===i||(e[r]=i),e}),{})}function xn(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=_n(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function wn(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=null!=e&&e.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function Cn(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isValid&&e.__unstableBlockSource)return hn(e.__unstableBlockSource);const n=e.name,r=xn(e);if(n===ue()||!t&&n===ce())return r;const o=pe(n);if(!o)return r;const i=kn(o,e.attributes);return wn(n,i,r)}(e,t))).join("\n\n")}var En=/[\t\n\f ]/,Sn=/[A-Za-z]/,In=/\r\n?/g;function Tn(e){return En.test(e)}function Nn(e){return Sn.test(e)}var Bn=function(){function e(e,t,n){void 0===n&&(n="precompile"),this.delegate=e,this.entityParser=t,this.mode=n,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||Nn(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){Tn(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();Tn(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();Tn(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!Tn(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();Tn(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();Tn(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();Tn(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();Tn(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();Tn(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();Tn(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();Tn(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();Tn(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();Tn(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();Tn(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();Tn(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();Tn(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||Nn(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(In,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Ln=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Bn(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t1?n-1:0),o=1;o[]}}function Mn(){const e=[],t=Rn();return{error(){for(var n=arguments.length,r=new Array(n),o=0;oe}}const On=/[\t\n\r\v\f ]+/g,Zn=/^[\t\n\r\v\f ]*$/,Fn=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,jn=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],zn=[...jn,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Hn=[e=>e,function(e){return Gn(e).join(" ")}],Vn=/^[\da-z]+$/i,Wn=/^#\d+$/,$n=/^#x[\da-f]+$/i;class Un{parse(e){if(t=e,Vn.test(t)||Wn.test(t)||$n.test(t))return(0,Dn.decodeEntities)("&"+e+";");var t}}function Gn(e){return e.trim().split(On)}function qn(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||zn.includes(t)}))}function Kn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rn(),r=e.chars,o=t.chars;for(let e=0;e{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),Xn(r.trim())]}));return Object.fromEntries(t)}const Qn={class:(e,t)=>{const[n,r]=[e,t].map(Gn),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>An()(...[e,t].map(Jn)),...Object.fromEntries(jn.map((e=>[e,()=>!0])))};function er(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rn();if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:Rn();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):er(...[e,t].map(qn),n)},Chars:Kn,Comment:Kn};function nr(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Zn.test(t.chars))return t}}function rr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rn();try{return new Ln(new Un).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}function or(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function ir(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Rn();if(e===t)return!0;const[r,o]=[e,t].map((e=>rr(e,n)));if(!r||!o)return!1;let i,l;for(;i=nr(r);){if(l=nr(o),!l)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==l.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",l.type,l,i.type,i),!1;const e=tr[i.type];if(e&&!e(i,l,n))return!1;or(i,o[0])?nr(o):or(l,r[0])&&nr(r)}return!(l=nr(o))||(n.warning("Expected %o, instead saw end of content.",l),!1)}function lr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name;const n=e.name===ce()||e.name===ue();if(n)return[!0,[]];const r=Mn(),o=Ze(t);let i;try{i=_n(o,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const l=ir(e.originalContent,i,r);return l||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",o.name,o,i,e.originalContent),[l,r.getItems()]}function ar(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}return"core/post-comments"===e&&(e="core/comments",n.legacy=!0),[e,n]}function sr(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}var cr,ur=function(){return cr||(cr=document.implementation.createHTMLDocument("")),cr};function dr(e,t){if(t){if("string"==typeof e){var n=ur();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){return n[r]=dr(e,t[r]),n}),{})}}function pr(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=n;if(e&&(r=n.querySelector(e)),r)return sr(r,t)}}var mr=n(35721),fr=n.n(mr);function hr(e){const t={};for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?vr(n.childNodes):[]}}var yr={concat:function(){(0,St.default)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const e=[];for(var t=arguments.length,n=new Array(t),r=0;rfunction(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=t.default),i}const kr=fr()((e=>{switch(e.source){case"attribute":let t=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(n){var r=pr(e,"attributes")(n);if(r&&r.hasOwnProperty(t))return r[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>(0,et.Z)([e,e=>void 0!==e]))(t)),t;case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;o{let n=t;e&&(n=t.querySelector(e));try{return gr(n)}catch(e){return null}}}(e.selector);case"query":const n=(0,U.mapValues)(e.query,kr);return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return dr(e,t)}))}}(e.selector,n);case"tag":return(0,et.Z)([pr(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}}));function xr(e){return dr(e,(e=>e))}function wr(e,t){return kr(t)(xr(e))}function Cr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=xr(t),o=Ze(e),i=(0,U.mapValues)(o.attributes,((e,o)=>_r(o,e,r,n,t)));return(0,_e.O)("blocks.getBlockAttributes",i,o,t,n)}const Er={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Sr(e){const t=wr(`
${e}
`,Er);return t?t.trim().split(/\s+/):[]}function Ir(e,t){const n=function(e,t,n){if(he(t,"customClassName",!0)){const{className:r,...o}=e,i=_n(t,o),l=Sr(i),a=Sr(n).filter((e=>!l.includes(e)));a.length?e.className=a.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Tr(){return!1}function Nr(e,t){let n=function(e,t){const n=ce(),r=e.blockName||ce(),o=e.attrs||{},i=e.innerBlocks||[];let l=e.innerHTML.trim();return r!==n||null!=t&&t.__unstableSkipAutop||(l=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),r=t.pop();e="";for(let r=0;r";n.push([l,o.substr(i)+""]),e+=o.substr(0,i)+l}e+=r}const r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=dn(e=(e=(e=(e=e.replace(/\s*/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("()","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("\s*/g,"")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));const o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.forEach((t=>{e+="

"+t.replace(/^\n*|\n*$/g,"")+"

\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/

\s*<\/p>/g,"")).replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

")).replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1")).replace(/

(/g,"$1")).replace(/

]*)>/gi,"

")).replace(/<\/blockquote><\/p>/g,"

")).replace(new RegExp("

\\s*(]*>)","g"),"$1")).replace(new RegExp("(]*>)\\s*

","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,""))),e=(e=e.replace(/
|/g,"
")).replace(/(
)?\s*\n/g,((e,t)=>t?e:"
\n")),e=e.replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"

"),n.forEach((t=>{const[n,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}(l).trim()),{...e,blockName:r,attrs:o,innerHTML:l,innerBlocks:i}}(e,t);n=function(e){const[t,n]=ar(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=pe(n.blockName);r||(n=function(e){const t=ue()||ce(),n=hn(e,{isCommentDelimited:!1}),r=hn(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=pe(n.blockName));const o=n.blockName===ce()||n.blockName===ue();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Nr(e,t))).filter((e=>!!e)),l=ke(n.blockName,Cr(r,n.innerHTML,n.attrs),i);l.originalContent=n.innerHTML;const a=function(e,t){const[n]=lr(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Ir(e,t),[o,i]=lr(e,t);return{...r,isValid:o,validationIssues:i}}(l,r),{validationIssues:s}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let t=0;t{let{log:t,args:n}=e;return t(...n)})):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,_n(r,c.attributes),c.originalContent),console.groupEnd()),c}function Br(e,t){return(e=>{Jt=e,Qt=0,en=[],tn=[],nn.lastIndex=0;do{}while(ln());return en})(e).reduce(((e,n)=>{const r=Nr(n,t);return r&&e.push(r),e}),[])}function Lr(){return Be("from").filter((e=>{let{type:t}=e;return"raw"===t})).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function Pr(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=Ne(Lr(),(t=>{let{isMatch:n}=t;return n(e)}));if(!n)return ke("core/html",Cr("core/html",e.outerHTML));const{transform:r,blockName:o}=n;return r?r(e,t):ke(o,Cr(o,e.outerHTML))}))}var Ar=n(95657),Dr=n(76119);function Rr(e){const t=document.implementation.createHTMLDocument(""),n=document.implementation.createHTMLDocument(""),r=t.body,o=n.body;for(r.innerHTML=e;r.firstChild;){const e=r.firstChild;e.nodeType===e.TEXT_NODE?(0,Ar.Z)(e)?r.removeChild(e):(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(o.appendChild(n.createElement("P")),r.removeChild(e.nextSibling)),o.lastChild&&"P"===o.lastChild.nodeName&&o.lastChild.hasChildNodes()?o.lastChild.appendChild(e):r.removeChild(e)):"P"===e.nodeName?(0,Ar.Z)(e)?r.removeChild(e):o.appendChild(e):(0,Dr.V2)(e)?(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(n.createElement("P")),o.lastChild.appendChild(e)):o.appendChild(e):r.removeChild(e)}return o.innerHTML}var Mr=n(78747),Or=n(56205);function Zr(e,t){e.nodeType===e.COMMENT_NODE&&("nextpage"!==e.nodeValue?0===e.nodeValue.indexOf("more")&&function(e,t){const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,(0,Or.Z)(r);break}const i=function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t);if(e.parentNode&&"P"===e.parentNode.nodeName&&1!==e.parentNode.childNodes.length){const n=Array.from(e.parentNode.childNodes),r=n.indexOf(e),o=e.parentNode.parentNode||t.body,l=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[n.slice(0,r).reduce(l,null),i,n.slice(r+1).reduce(l,null)].forEach((t=>t&&o.insertBefore(t,e.parentNode))),(0,Or.Z)(e.parentNode)}else(0,Mr.Z)(e,i)}(e,t):(0,Mr.Z)(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t)))}var Fr=n(7391);function jr(e){return"OL"===e.nodeName||"UL"===e.nodeName}function zr(e){if(!jr(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((e=>{let{nodeValue:t=""}=e;return t})).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&jr(r)){const t=e.previousElementSibling;t?t.appendChild(e):(0,Fr.Z)(e)}}function Hr(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=Rr(e.innerHTML))}function Vr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Wr(e,t,n){if(!function(e,t){var n,r;const o=e.nodeName.toLowerCase();return"figcaption"!==o&&!(0,Dr.my)(e)&&o in(null!==(n=null==t||null===(r=t.figure)||void 0===r?void 0:r.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n,r,o,i;return e.nodeName.toLowerCase()in(null!==(n=null==t||null===(r=t.figure)||void 0===r||null===(o=r.children)||void 0===o||null===(i=o.a)||void 0===i?void 0:i.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Vr(r,i):Vr(r,i):"BODY"===r.parentNode.nodeName&&Vr(r)}function $r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Ur(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return $r(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:qr(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function Ur(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const Gr=fr()((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function qr(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new Kr({tag:e[2],attrs:e[3],type:t,content:e[5]})}const Kr=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=Gr(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((e=>{let[t,n]=e;this.set(t,n)}))}),{next:$r,replace:function(e,t,n){return t.replace(Ur(e),(function(e,t,r,o,i,l,a,s){if("["===t&&"]"===s)return e;const c=n(qr(arguments));return c||""===c?t+c+s:e}))},string:function(e){return new Kr(e).string()},regexp:Ur,attrs:Gr,fromMatch:qr});Object.assign(Kr.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach((t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t})),Object.entries(this.attrs.named).forEach((t=>{let[n,r]=t;e+=" "+n+'="'+r+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const Yr=e=>Array.isArray(e)?e:[e];var Xr=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const o=Be("from"),i=Ne(o,(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&Yr(e.tag).some((e=>Ur(e).test(t)))));if(!i)return[t];const l=Yr(i.tag),a=l.find((e=>Ur(e).test(t)));let s;const c=n;if(s=$r(a,t,n)){var u;n=s.index+s.content.length;const o=t.substr(0,s.index),l=t.substr(n);if(!(null!==(u=s.shortcode.content)&&void 0!==u&&u.includes("<")||/(\n|

)\s*$/.test(o)&&/^\s*(\n|<\/p>)/.test(l)))return e(t,n);if(i.isMatch&&!i.isMatch(s.shortcode.attrs))return e(t,c,[...r,i.blockName]);let a=[];if("function"==typeof i.transform)a=[].concat(i.transform(s.shortcode.attrs,s)),a=a.map((e=>(e.originalContent=s.shortcode.content,Ir(e,pe(e.name)))));else{const e=Object.fromEntries(Object.entries(i.attributes).filter((e=>{let[,t]=e;return t.shortcode})).map((e=>{let[t,n]=e;return[t,n.shortcode(s.shortcode.attrs,s)]}))),n=pe(i.blockName);if(!n)return[t];const r={...n,attributes:i.attributes};let o=ke(i.blockName,Cr(r,s.shortcode.content,e));o.originalContent=s.shortcode.content,o=Ir(o,r),a=[o]}return[...e(o),...a,...e(l)]}return[t]};function Jr(e){return function(e,t){const n={phrasingContentSchema:(0,Dr.s3)(t),isPaste:"paste"===t},r=e.map((e=>{let{isMatch:t,blockName:r,schema:o}=e;const i=he(r,"anchor");return o="function"==typeof o?o(n):o,i||t?(0,U.mapValues)(o,(e=>{let n=e.attributes||[];return i&&(n=[...n,"id"]),{...e,attributes:n,isMatch:t||void 0}})):o}));return(0,U.mergeWith)({},...r,((e,t,n)=>{switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return function(){return e(...arguments)||t(...arguments)}}}))}(Lr(),e)}function Qr(e,t,n,r){Array.from(e).forEach((e=>{Qr(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function eo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Qr(r.body.childNodes,t,r,n),r.body.innerHTML}function to(e,t){const n=e[`${t}Sibling`];if(n&&(0,Dr.V2)(n))return n;const{parentNode:r}=e;return r&&(0,Dr.V2)(r)?to(r,t):void 0}function no(e){let{HTML:t=""}=e;if(-1!==t.indexOf("\x3c!-- wp:"))return Br(t);const n=Xr(t),r=Jr();return n.map((e=>"string"!=typeof e?e:Pr(e=Rr(e=eo(e,[zr,Zr,Wr,Hr],r)),no))).flat().filter(Boolean)}var ro=n(47534);function oo(e){e.nodeType===e.COMMENT_NODE&&(0,Or.Z)(e)}function io(e,t){return e.every((e=>function(e,t){if((0,Dr.my)(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[n,t].filter((t=>!e.includes(t))).length))}(e,t)&&io(Array.from(e.children),t)))}function lo(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}var ao=n(4599),so=n(26750);function co(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:l}=e.style;"bold"!==n&&"700"!==n||(0,ao.Z)(t.createElement("strong"),e),"italic"===r&&(0,ao.Z)(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&(0,ao.Z)(t.createElement("s"),e),"super"===l?(0,ao.Z)(t.createElement("sup"),e):"sub"===l&&(0,ao.Z)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,so.Z)(e,"strong"):"I"===e.nodeName?e=(0,so.Z)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function uo(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}const{parseInt:po}=window;function mo(e){return"OL"===e.nodeName||"UL"===e.nodeName}function fo(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n)return;if(-1===n.indexOf("mso-list"))return;const r=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);if(!r)return;let o=po(r[1],10)-1||0;const i=e.previousElementSibling;if(!i||!mo(i)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const l=e.previousElementSibling,a=l.nodeName,s=t.createElement("li");let c=l;for(e.removeChild(e.firstChild);e.firstChild;)s.appendChild(e.firstChild);for(;o--;)c=c.lastChild||c,mo(c)&&(c=c.lastChild||c);mo(c)||(c=c.appendChild(t.createElement(a))),c.appendChild(s),e.parentNode.removeChild(e)}const{atob:ho,File:go}=window;function vo(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=ho(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;e]+>/g,""),t=t.replace(/^\s*]*>\s*]*>(?:\s*)?/i,""),t=t.replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==r){const e=t||n;if(-1!==e.indexOf("\x3c!-- wp:"))return Br(e)}var l;if(String.prototype.normalize&&(t=t.normalize()),!n||t&&!function(e){return!/<(?!br[ />])/i.test(e)}(t)||(t=n,/^\s+$/.test(n)||(l=t,t=_o.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(l)))),"AUTO"===r&&-1===n.indexOf("\n")&&0!==n.indexOf("

")&&0===t.indexOf("

")&&(r="INLINE")),"INLINE"===r)return To(t,i);t=eo(t,[So]);const a=Xr(t),s=a.length>1;if("AUTO"===r&&!s&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(lo)&&io(r,t)}(t,o))return To(t,i);const c=(0,Dr.s3)("paste"),u=Jr("paste"),d=a.map((e=>{if("string"!=typeof e)return e;const t=[xo,fo,uo,zr,vo,co,Zr,oo,ko,Wr,Hr,bo],n={...u,...c};return e=eo(e,t,u),e=eo(e=Rr(e=(0,ro.Z)(e,n)),[wo,Co,Eo],u),Io.log("Processed HTML piece:\n\n",e),Pr(e,No)})).flat().filter(Boolean);if("AUTO"===r&&1===d.length&&he(d[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,t=n.replace(e,"");if(""!==t&&-1===t.indexOf("\n"))return(0,ro.Z)(xn(d[0]),c).replace(e,"")}return d}function Bo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&t.every(((t,n)=>{let[r,,o]=t;const i=e[n];return r===i.name&&Bo(i.innerBlocks,o)}))}function Lo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?t.map(((t,n)=>{var r;let[o,i,l]=t;const a=e[n];if(a&&a.name===o){const e=Lo(a.innerBlocks,l);return{...a,innerBlocks:e}}const s=pe(o),c=(e,t)=>t?Object.fromEntries(Object.entries(t).map((t=>{let[n,r]=t;return[n,u(e[n],r)]}))):{},u=(e,t)=>{return"html"===(null==(n=e)?void 0:n.source)&&Array.isArray(t)?(0,mn.ZP)(t):(e=>"query"===(null==e?void 0:e.source))(e)&&t?t.map((t=>c(e.query,t))):t;var n},d=c(null!==(r=null==s?void 0:s.attributes)&&void 0!==r?r:{},i);let[p,m]=ar(o,d);return void 0===pe(p)&&(m={originalName:o,originalContent:"",originalUndelimitedContent:""},p="core/missing"),ke(p,m,Lo([],l))})):e}(0,_e.KJ)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&he(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var Po=n(48041),Ao=n(56662),Do=n(819),Ro=n(43039),Mo=n(903),Oo=n(75527),Zo=e=>(0,v.createElement)("div",{className:e.className},e.children),Fo=(0,v.forwardRef)((function(e,t){let{containerClassName:n,className:r,extraProps:o,children:i,title:l,isActive:a,isDisabled:s,...c}=e;return(0,v.useContext)(Ro.Z)?(0,v.createElement)(Oo.Z,(0,Po.Z)({className:w()("components-toolbar-button",r)},o,c,{ref:t}),(e=>(0,v.createElement)(Mo.ZP,(0,Po.Z)({label:l,isPressed:a,disabled:s},e),i))):(0,v.createElement)(Zo,{className:n},(0,v.createElement)(Mo.ZP,(0,Po.Z)({ref:t,icon:c.icon,label:l,shortcut:c.shortcut,"data-subscript":c.subscript,onClick:e=>{e.stopPropagation(),c.onClick&&c.onClick(e)},className:w()("components-toolbar__control",r),isPressed:a,disabled:s,"data-toolbar-item":!0},o,c),i))})),jo=e=>{let{className:t,children:n,...r}=e;return(0,v.createElement)("div",(0,Po.Z)({className:t},r),n)},zo=n(86849),Ho=function(e){let{controls:t=[],toggleProps:n,...r}=e;const o=e=>(0,v.createElement)(zo.Z,(0,Po.Z)({controls:t,toggleProps:{...e,"data-toolbar-item":!0}},r));return(0,v.useContext)(Ro.Z)?(0,v.createElement)(Oo.Z,n,o):o(n)},Vo=function(e){var t;let{controls:n=[],children:r,className:o,isCollapsed:i,title:l,...a}=e;const s=(0,v.useContext)(Ro.Z);if(!(n&&n.length||r))return null;const c=w()(s?"components-toolbar-group":"components-toolbar",o);let u=n;return Array.isArray(u[0])||(u=[u]),i?(0,v.createElement)(Ho,(0,Po.Z)({label:l,controls:u,className:c,children:r},a)):(0,v.createElement)(jo,(0,Po.Z)({className:c},a),null===(t=u)||void 0===t?void 0:t.flatMap(((e,t)=>e.map(((e,n)=>(0,v.createElement)(Fo,(0,Po.Z)({key:[t,n].join(),containerClassName:t>0&&0===n?"has-left-divider":null},e)))))),r)},Wo={default:(0,I.up)("BlockControls"),block:(0,I.up)("BlockControlsBlock"),inline:(0,I.up)("BlockFormatControls"),other:(0,I.up)("BlockControlsOther"),parent:(0,I.up)("BlockControlsParent")};const $o={insertUsage:{}},Uo={alignWide:!1,supportsLayout:!0,colors:[{name:(0,N.__)("Black"),slug:"black",color:"#000000"},{name:(0,N.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,N.__)("White"),slug:"white",color:"#ffffff"},{name:(0,N.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,N.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,N.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,N.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,N.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,N.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,N.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,N.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,N.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,N._x)("Small","font size name"),size:13,slug:"small"},{name:(0,N._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,N._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,N._x)("Large","font size name"),size:36,slug:"large"},{name:(0,N._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,N.__)("Thumbnail")},{slug:"medium",name:(0,N.__)("Medium")},{slug:"large",name:(0,N.__)("Large")},{slug:"full",name:(0,N.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,N.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,N.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,N.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,N.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,N.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,N.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,N.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,N.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,N.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,N.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,N.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,N.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function Go(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function qo(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const o=[...e];return o.splice(t,r),Go(o,e.slice(t,t+r),n)}const Ko=e=>e;function Yo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),Yo(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function Xo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=[],r=[[t,e]];for(;r.length;){const[e,t]=r.shift();t.forEach((t=>{let{innerBlocks:o,...i}=t;n.push([i.clientId,e]),null!=o&&o.length&&r.push([i.clientId,o])}))}return n}function Jo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ko;const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function Qo(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}function ei(e){return Jo(e,(e=>{const{attributes:t,...n}=e;return n}))}function ti(e){return Jo(e,(e=>e.attributes))}function ni(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&An()(e.clientIds,t.clientIds)&&function(e,t){return An()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function ri(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function oi(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const ii=(0,et.Z)($.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),ri(r,n.blocks),oi(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),oi(r,[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),oi(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=Qo(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),ri(r,n.blocks),oi(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds)void 0===t.parents.get(e)||""!==t.parents.get(e)&&!r.byClientId.get(t.parents.get(e))||o.push(t.parents.get(e));oi(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds)void 0===t.parents.get(o)||""!==t.parents.get(o)&&!r.byClientId.get(t.parents.get(o))||e.push(t.parents.get(o));r.tree=new Map(r.tree),n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e))).forEach((e=>{r.tree.delete(e)})),oi(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),oi(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),oi(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),oi(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(ei(n.blocks)),attributes:new Map(ti(n.blocks)),order:Yo(n.blocks),parents:new Map(Xo(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(null==t?void 0:t.tree),ri(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n=!1;return(r,o)=>{let i=e(r,o);const l="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||n;if(r===i&&!l){var a;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type;const e=null===(a=null==r?void 0:r.isPersistentChange)||void 0===a||a;return r.isPersistentChange===e?r:{...i,isPersistentChange:e}}return i={...i,isPersistentChange:l?!n:!ni(o,t)},t=o,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,i}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return ei(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),ei(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return ti(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const l=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===l.length)continue;let a=!1;const s=e.get(i),c={};l.forEach((e=>{let[t,n]=e;s[t]!==n&&(a=!0,c[t]=n)})),r=r||a,a&&o.set(i,{...s,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),ti(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=Yo(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=Yo(t.blocks,n),{index:i=r.length}=t,l=new Map(e);return o.forEach(((e,t)=>{l.set(t,e)})),l.set(n,Go(r,o.get(n),i)),l}case"MOVE_BLOCKS_TO_POSITION":{var r,o;const{fromRootClientId:n="",toRootClientId:i="",clientIds:l}=t,{index:a=e.get(i).length}=t;if(n===i){const t=e.get(i).indexOf(l[0]),n=new Map(e);return n.set(i,qo(e.get(i),t,a,l.length)),n}const s=new Map(e);return s.set(n,null!==(r=null===(o=e.get(n))||void 0===o?void 0:o.filter((e=>!l.includes(e))))&&void 0!==r?r:[]),s.set(i,Go(e.get(i),l,a)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const l=i.indexOf(o),a=new Map(e);return a.set(r,qo(i,l,l-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],l=e.get(r);if(!l.length||i===l[l.length-1])return e;const a=l.indexOf(o),s=new Map(e);return s.set(r,qo(l,a,a+1,n.length)),s}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=Yo(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=null==e?void 0:e.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return Xo(t.blocks).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return Xo(t.blocks,t.rootClientId||"").forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),Xo(t.blocks,e.get(t.clientIds[0])).forEach((e=>{let[t,r]=e;n.set(t,r)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:r}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e}});function li(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const ai=(0,$.combineReducers)({blocks:ii,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,r;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;switch(i.type){case"SELECTION_CHANGE":return i.clientId?{selectionStart:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.startOffset},selectionEnd:{clientId:i.clientId,attributeKey:i.attributeKey,offset:i.endOffset}}:{selectionStart:i.start||o.selectionStart,selectionEnd:i.end||o.selectionEnd};case"RESET_SELECTION":const{selectionStart:l,selectionEnd:a}=i;return{selectionStart:l,selectionEnd:a};case"MULTI_SELECT":const{start:s,end:c}=i;return s===(null===(e=o.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=o.selectionEnd)||void 0===t?void 0:t.clientId)?o:{selectionStart:{clientId:s},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==o||null===(n=o.selectionStart)||void 0===n?void 0:n.clientId,d=null==o||null===(r=o.selectionEnd)||void 0===r?void 0:r.clientId;if(!u&&!d)return o;if(!i.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!i.blocks.some((e=>e.clientId===d)))return{...o,selectionEnd:o.selectionStart}}const l=li(o.selectionStart,i),a=li(o.selectionEnd,i);return l===o.selectionStart&&a===o.selectionEnd?o:{selectionStart:l,selectionEnd:a}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.clientIds.includes(n)})));case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;if(!t.settings){if(e.hasOwnProperty(n)){const{[n]:t,...r}=e;return r}return e}return An()(e[n],t.settings)?e:{...e,[n]:t.settings}}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i}=t,l={rootClientId:n,index:r,__unstableWithInserter:o,operation:i};return An()(e,l)?e:l}case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Uo,t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$o,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n,i=(0,$.select)(Xt).getActiveBlockVariation(o,r);let l=null!=i&&i.name?`${o}/${i.name}`:o;const a={name:l};return"core/block"===o&&(a.ref=r.ref,l+="/"+r.ref),{...e,insertUsage:{...e.insertUsage,[l]:{time:t.time,count:e.insertUsage[l]?e.insertUsage[l].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},editorMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"edit",t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":case"REPLACE_INNER_BLOCKS":if(!n.blocks.length)return t;const r=n.blocks.map((e=>e.clientId));return{clientIds:r,source:null===(e=n.meta)||void 0===e?void 0:e.source};case"RESET_BLOCKS":return{}}return t},temporarilyEditingAsBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},blockVisibility:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});var si=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(ai),ci=n(37392),ui=n(23353),di=(0,$.combineReducers)({formatTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.names.includes(n)})))}return e}});const pi=(0,Xe.Z)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function mi(e,t){return e.formatTypes[t]}function fi(e,t){const n=pi(e);return n.find((e=>{let{className:n,tagName:r}=e;return null===n&&t===r}))||n.find((e=>{let{className:t,tagName:n}=e;return null===t&&"*"===n}))}function hi(e,t){return pi(e).find((e=>{let{className:n}=e;return null!==n&&` ${t} `.indexOf(` ${n} `)>=0}))}function gi(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function vi(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const bi=(0,W.Z)("core/rich-text",{reducer:di,selectors:l,actions:a});function yi(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;const l=o.length;for(let e=0;e{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];yi(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function ki(e,t,n){return(e=e.slice())[t]=n,e}function xi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:o,activeFormats:i}=e,l=o.slice();if(n===r){var a;const e=null===(a=l[n])||void 0===a?void 0:a.find((e=>{let{type:n}=e;return n===t.type}));if(e){const o=l[n].indexOf(e);for(;l[n]&&l[n][o]===e;)l[n]=ki(l[n],o,t),n--;for(r++;l[r]&&l[r][o]===e;)l[r]=ki(l[r],o,t),r++}}else{let e=1/0;for(let o=n;o{let{type:n}=e;return n!==t.type}));const n=l[o].length;n{let{type:n}=e;return n!==t.type})))||[],t]})}function wi(e,t){let{implementation:n}=e;return wi.body||(wi.body=n.createHTMLDocument("").body),wi.body.innerHTML=t,wi.body}(0,$.register)(bi);const Ci="\u2028",Ei="";function Si(e){let t,{tagName:n,attributes:r}=e;if(r&&r.class&&(t=(0,$.select)(bi).getFormatTypeForClassName(r.class),t&&(r.class=` ${r.class} `.replace(` ${t.className} `," ").trim(),r.class||delete r.class)),t||(t=(0,$.select)(bi).getFormatTypeForBareElement(n)),!t)return r?{type:n,attributes:r}:{type:n};if(t.__experimentalCreatePrepareEditableTree&&!t.__experimentalCreateOnChangeEditableValue)return null;if(!r)return{type:t.name,tagName:n};const o={},i={},l={...r};for(const e in t.attributes){const n=t.attributes[e];o[e]=l[n],t.__unstableFilterAttributeValue&&(o[e]=t.__unstableFilterAttributeValue(e,o[e])),delete l[n],void 0===o[e]&&delete o[e]}for(const e in l)i[e]=r[e];return{type:t.name,tagName:n,attributes:o,unregisteredAttributes:i}}function Ii(){let{element:e,text:t,html:n,range:r,multilineTag:o,multilineWrapperTags:i,__unstableIsEditableTree:l,preserveWhiteSpace:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=wi(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:o?Ai({element:e,range:r,multilineTag:o,multilineWrapperTags:i,isEditableTree:l,preserveWhiteSpace:a}):Pi({element:e,range:r,isEditableTree:l,preserveWhiteSpace:a}))}function Ti(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:i,startOffset:l,endContainer:a,endOffset:s}=n,c=e.text.length;void 0!==r.start?e.start=c+r.start:t===i&&t.nodeType===t.TEXT_NODE?e.start=c+l:o===i&&t===i.childNodes[l]?e.start=c:o===i&&t===i.childNodes[l-1]?e.start=c+r.text.length:t===i&&(e.start=c),void 0!==r.end?e.end=c+r.end:t===a&&t.nodeType===t.TEXT_NODE?e.end=c+s:o===a&&t===a.childNodes[s-1]?e.end=c+r.text.length:o===a&&t===a.childNodes[s]?e.end=c:t===a&&(e.end=c+s)}function Ni(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:i,endOffset:l}=t;return e===r&&(i=n(e.nodeValue.slice(0,i)).length),e===o&&(l=n(e.nodeValue.slice(0,l)).length),{startContainer:r,startOffset:i,endContainer:o,endOffset:l}}function Bi(e){return e.replace(/[\n\r\t]+/g," ")}function Li(e){return e.replace(new RegExp("[\ufeff]","gu"),"")}function Pi(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:o,currentWrapperTags:i=[],isEditableTree:l,preserveWhiteSpace:a}=e;const s={formats:[],replacements:[],text:""};if(!t)return s;if(!t.hasChildNodes())return Ti(s,t,n,{formats:[],replacements:[],text:""}),s;const c=t.childNodes.length;for(let u=0;uLi(Bi(e)));const g=h(d.nodeValue);n=Ni(d,n,h),Ti(s,d,n,{text:g}),s.formats.length+=g.length,s.replacements.length+=g.length,s.text+=g;continue}if(d.nodeType!==d.ELEMENT_NODE)continue;if(l&&(d.getAttribute("data-rich-text-placeholder")||"br"===p&&!d.getAttribute("data-rich-text-line-break"))){Ti(s,d,n,{formats:[],replacements:[],text:""});continue}if("script"===p){const v={formats:[,],replacements:[{type:p,attributes:{"data-rich-text-script":d.getAttribute("data-rich-text-script")||encodeURIComponent(d.innerHTML)}}],text:Ei};Ti(s,d,n,v),Ri(s,v);continue}if("br"===p){Ti(s,d,n,{formats:[],replacements:[],text:""}),Ri(s,Ii({text:"\n"}));continue}const m=Si({tagName:p,attributes:Di({element:d})});if(o&&-1!==o.indexOf(p)){const b=Ai({element:d,range:n,multilineTag:r,multilineWrapperTags:o,currentWrapperTags:[...i,m],isEditableTree:l,preserveWhiteSpace:a});Ti(s,d,n,b),Ri(s,b);continue}const f=Pi({element:d,range:n,multilineTag:r,multilineWrapperTags:o,isEditableTree:l,preserveWhiteSpace:a});if(Ti(s,d,n,f),m)if(0===f.text.length)m.attributes&&Ri(s,{formats:[,],replacements:[m],text:Ei});else{function y(e){if(y.formats===e)return y.newFormats;const t=e?[m,...e]:[m];return y.formats=e,y.newFormats=t,t}y.newFormats=[m],Ri(s,{...f,formats:Array.from(f.formats,y)})}else Ri(s,f)}return s}function Ai(e){let{element:t,range:n,multilineTag:r,multilineWrapperTags:o,currentWrapperTags:i=[],isEditableTree:l,preserveWhiteSpace:a}=e;const s={formats:[],replacements:[],text:""};if(!t||!t.hasChildNodes())return s;const c=t.children.length;for(let e=0;e0)&&Ri(s,{formats:[,],replacements:i.length>0?[i]:[,],text:Ci}),Ti(s,c,n,u),Ri(s,u)}return s}function Di(e){let{element:t}=e;if(!t.hasAttributes())return;const n=t.attributes.length;let r;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===n)return i;if(n===r){if(o)return o;const e=t[n-1]||i,r=t[n]||i;return e.length{let{type:n}=e;return n===t}))}const Zi=new RegExp("[\u2028]","g");function Fi(e){let{text:t}=e;return t.replace(Zi,(e=>e===Ei?"":"\n"))}function ji(e){let{start:t,end:n}=e;if(void 0!==t&&void 0!==n)return t===n}function zi(e){let{text:t}=e;return 0===t.length}function Hi(e){let{text:t,start:n,end:r}=e;return n===r&&(0===t.length||0===n&&t.slice(0,1)===Ci||n===t.length&&t.slice(-1)===Ci||"\u2028\u2028"===t.slice(n-1,r+1))}function Vi(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,$.select)(bi).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=(0,$.select)(bi).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,$.select)(bi).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,$.dispatch)(bi).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function Wi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:o,activeFormats:i}=e,l=o.slice();if(n===r){var a;const e=null===(a=l[n])||void 0===a?void 0:a.find((e=>{let{type:n}=e;return n===t}));if(e){for(;null!==(s=l[n])&&void 0!==s&&s.find((t=>t===e));){var s;$i(l,n,t),n--}for(r++;null!==(c=l[r])&&void 0!==c&&c.find((t=>t===e));){var c;$i(l,r,t),r++}}}else for(let e=n;e{let{type:n}=e;return n!==t})))||[]})}function $i(e,t,n){const r=e[t].filter((e=>{let{type:t}=e;return t!==n}));r.length?e[t]=r:delete e[t]}function Ui(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const{formats:o,replacements:i,text:l}=e;"string"==typeof t&&(t=Ii({text:t}));const a=n+t.text.length;return _i({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:i.slice(0,n).concat(t.replacements,i.slice(r)),text:l.slice(0,n)+t.text+l.slice(r),start:a,end:a})}function Gi(e,t,n){return Ui(e,Ii(),t,n)}function qi(e,t,n){let{formats:r,replacements:o,text:i,start:l,end:a}=e;return i=i.replace(t,(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const{formats:r,replacements:o,text:i}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:i.slice(t,n)}}function Yi(e,t){let{formats:n,replacements:r,text:o,start:i,end:l}=e;if("string"!=typeof t)return Xi(...arguments);let a=0;return o.split(t).map((e=>{const o=a,s={formats:n.slice(o,o+e.length),replacements:r.slice(o,o+e.length),text:e};return a+=t.length+e.length,void 0!==i&&void 0!==l&&(i>=o&&io&&(s.start=0),l>=o&&la&&(s.end=e.length)),s}))}function Xi(e){let{formats:t,replacements:n,text:r,start:o,end:i}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;if(void 0===o||void 0===i)return;const s={formats:t.slice(0,l),replacements:n.slice(0,l),text:r.slice(0,l)},c={formats:t.slice(a),replacements:n.slice(a),text:r.slice(a),start:0,end:0};return[qi(s,/\u2028+$/,""),qi(c,/^\u2028+/,"")]}var Ji=n(7969);function Qi(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice("data-disable-rich-text-".length)),n[r]=e[t]}return n}function el(e){let{type:t,tagName:n,attributes:r,unregisteredAttributes:o,object:i,boundaryClass:l,isEditableTree:a}=e;const s=(c=t,(0,$.select)(bi).getFormatType(c));var c;let u={};if(l&&(u["data-rich-text-format-boundary"]="true"),!s)return r&&(u={...r,...u}),{type:t,attributes:Qi(u,a),object:i};u={...o,...u};for(const e in r){const t=!!s.attributes&&s.attributes[e];t?u[t]=r[e]:u[e]=r[e]}return s.className&&(u.class?u.class=`${s.className} ${u.class}`:u.class=s.className),{type:"*"===s.tagName?n:s.tagName,object:s.object,attributes:Qi(u,a)}}function tl(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function nl(e){let{value:t,multilineTag:n,preserveWhiteSpace:r,createEmpty:o,append:i,getLastChild:l,getParent:a,isText:s,getText:c,remove:u,appendText:d,onStartIndex:p,onEndIndex:m,isEditableTree:f,placeholder:h}=e;const{formats:g,replacements:v,text:b,start:y,end:_}=t,k=g.length+1,x=o(),w={type:n},C=Mi(t),E=C[C.length-1];let S,I,T;n?(i(i(x,{type:n}),""),I=S=[w]):i(x,"");for(let e=0;e(e.push(t,w),e)),[w]):[...S,...k||[]]);let C=l(x);if(o&&t===Ci){let e=C;for(;!s(e);)e=l(e);i(a(e),"\ufeff")}if(T===Ci){let t=C;for(;!s(t);)t=l(t);p&&y===e&&p(x,t),m&&_===e&&m(x,t)}var N;if(k&&k.forEach(((e,n)=>{if(C&&I&&tl(k,I,n)&&(t!==Ci||k.length-1!==n))return void(C=l(C));const{type:r,tagName:o,attributes:d,unregisteredAttributes:p}=e,m=f&&t!==Ci&&e===E,h=a(C),g=i(h,el({type:r,tagName:o,attributes:d,unregisteredAttributes:p,boundaryClass:m,isEditableTree:f}));s(C)&&0===c(C).length&&u(C),C=i(g,"")})),t!==Ci)0===e&&(p&&0===y&&p(x,C),m&&0===_&&m(x,C)),t===Ei?(f||"script"!==(null===(N=v[e])||void 0===N?void 0:N.type)?C=i(a(C),el({...v[e],object:!0,isEditableTree:f})):(C=i(a(C),el({type:"script",isEditableTree:f})),i(C,{html:decodeURIComponent(v[e].attributes["data-rich-text-script"])})),C=i(a(C),"")):r||"\n"!==t?s(C)?d(C,t):C=i(a(C),t):(C=i(a(C),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),C=i(a(C),"")),p&&y===e+1&&p(x,C),m&&_===e+1&&m(x,C),o&&e===b.length&&(i(a(C),"\ufeff"),h&&0===b.length&&i(a(C),{type:"span",attributes:{"data-rich-text-placeholder":h,contenteditable:"false",style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),I=k,T=t;else I=k,T=t}return x}function rl(e){let{value:t,multilineTag:n,preserveWhiteSpace:r}=e;return ml(nl({value:t,multilineTag:n,preserveWhiteSpace:r,createEmpty:ol,append:ll,getLastChild:il,getParent:sl,isText:cl,getText:ul,remove:dl,appendText:al}).children)}function ol(){return{}}function il(e){let{children:t}=e;return t&&t[t.length-1]}function ll(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function al(e,t){e.text+=t}function sl(e){let{parent:t}=e;return t}function cl(e){let{text:t}=e;return"string"==typeof t}function ul(e){let{text:t}=e;return t}function dl(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function pl(e){let{type:t,attributes:n,object:r,children:o}=e,i="";for(const e in n)(0,Ji.$b)(e)&&(i+=` ${e}="${(0,Ji.kb)(n[e])}"`);return r?`<${t}${i}>`:`<${t}${i}>${ml(o)}`}function ml(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>void 0!==e.html?e.html:void 0===e.text?pl(e):(0,Ji.N2)(e.text))).join("")}var fl=n(15439);function hl(e,t){return Oi(e,t.type)?(t.title&&(0,fl.D)((0,N.sprintf)((0,N.__)("%s removed."),t.title),"assertive"),Wi(e,t.type)):(t.title&&(0,fl.D)((0,N.sprintf)((0,N.__)("%s applied."),t.title),"assertive"),xi(e,t))}function gl(e){let{editableContentElement:t,value:n,settings:r={}}=e;const{tagName:o,className:i,name:l}=r,a=l?Oi(n,l):void 0;return(0,v.useMemo)((()=>{if(!t)return;const{ownerDocument:{defaultView:e}}=t,n=e.getSelection();if(!n.rangeCount)return;const r=null==t?void 0:t.contains(null==n?void 0:n.anchorNode),l=n.getRangeAt(0);if(!a)return{ownerDocument:l.startContainer.ownerDocument,getBoundingClientRect:()=>r?l.getBoundingClientRect():t.getBoundingClientRect()};let s=l.startContainer;for(s=s.nextElementSibling||s;s.nodeType!==s.ELEMENT_NODE;)s=s.parentNode;return s.closest(o+(i?"."+i:""))}),[t,a,n.start,n.end,o,i])}var vl=n(90552),bl=n(23889),yl=n(10962);function _l(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=_l(r,t,n)),n}function kl(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function xl(e,t){"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n){t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function wl(e,t){e.appendData(t)}function Cl(e){let{lastChild:t}=e;return t}function El(e){let{parentNode:t}=e;return t}function Sl(e){return e.nodeType===e.TEXT_NODE}function Il(e){let{nodeValue:t}=e;return t}function Tl(e){return e.parentNode.removeChild(e)}function Nl(e){let{value:t,current:n,multilineTag:r,prepareEditableTree:o,__unstableDomOnly:i,placeholder:l}=e;const{body:a,selection:s}=function(e){let{value:t,multilineTag:n,prepareEditableTree:r,isEditableTree:o=!0,placeholder:i,doc:l=document}=e,a=[],s=[];r&&(t={...t,formats:r(t)});const c=nl({value:t,multilineTag:n,createEmpty:()=>wi(l,""),append:xl,getLastChild:Cl,getParent:El,isText:Sl,getText:Il,remove:Tl,appendText:wl,onStartIndex(e,t){a=_l(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=_l(t,e,[t.nodeValue.length])},isEditableTree:o,placeholder:i});return{body:c,selection:{startPath:a,endPath:s}}}({value:t,multilineTag:r,prepareEditableTree:o,placeholder:l,doc:n.ownerDocument});Bl(a,n),void 0===t.start||i||function(e,t){let{startPath:n,endPath:r}=e;const{node:o,offset:i}=kl(t,n),{node:l,offset:a}=kl(t,r),{ownerDocument:s}=t,{defaultView:c}=s,u=c.getSelection(),d=s.createRange();d.setStart(o,i),d.setEnd(l,a);const{activeElement:p}=s;if(u.rangeCount>0){if(function(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}(d,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(d),p!==s.activeElement&&p instanceof c.HTMLElement&&p.focus()}(s,n)}function Bl(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e{if(!r||!r.length)return;const e="*[data-rich-text-format-boundary]",t=n.current.querySelector(e);if(!t)return;const{ownerDocument:o}=t,{defaultView:i}=o,l=`.rich-text:focus ${e} {background-color: ${i.getComputedStyle(t).color.replace(")",", 0.2)").replace("rgb","rgba")}}`,a="rich-text-boundary-style";let s=o.getElementById(a);s||(s=o.createElement("style"),s.id=a,o.head.appendChild(s)),s.innerHTML!==l&&(s.innerHTML=l)}),[r]),n}function Pl(e){const t=(0,v.useRef)(e);return t.current=e,(0,bl.Z)((e=>{function n(n){const{record:r,multilineTag:o,preserveWhiteSpace:i}=t.current;if(ji(r.current)||!e.contains(e.ownerDocument.activeElement))return;const l=Ki(r.current),a=Fi(l),s=rl({value:l,multilineTag:o,preserveWhiteSpace:i});n.clipboardData.setData("text/plain",a),n.clipboardData.setData("text/html",s),n.clipboardData.setData("rich-text","true"),n.clipboardData.setData("rich-text-multi-line-tag",o||""),n.preventDefault()}return e.addEventListener("copy",n),()=>{e.removeEventListener("copy",n)}}),[])}var Al=n(50899);const Dl=[];function Rl(e){const[,t]=(0,v.useReducer)((()=>({}))),n=(0,v.useRef)(e);return n.current=e,(0,bl.Z)((e=>{function r(r){const{keyCode:o,shiftKey:i,altKey:l,metaKey:a,ctrlKey:s}=r;if(i||l||a||s||o!==Al.LEFT&&o!==Al.RIGHT)return;const{record:c,applyRecord:u}=n.current,{text:d,formats:p,start:m,end:f,activeFormats:h=[]}=c.current,g=ji(c.current),{ownerDocument:v}=e,{defaultView:b}=v,{direction:y}=b.getComputedStyle(e),_="rtl"===y?Al.RIGHT:Al.LEFT,k=r.keyCode===_;if(g&&0===h.length){if(0===m&&k)return;if(f===d.length&&!k)return}if(!g)return;const x=p[m-1]||Dl,w=p[m]||Dl,C=k?x:w,E=h.every(((e,t)=>e===C[t]));let S=h.length;if(E?S{e.removeEventListener("keydown",r)}}),[])}const Ml=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Ol=[],Zl="data-rich-text-placeholder";function Fl(e){const t=(0,v.useRef)(e);return t.current=e,(0,bl.Z)((e=>{const{ownerDocument:n}=e,{defaultView:r}=n;let o=!1;function i(e){if(o)return;let n;e&&(n=e.inputType);const{record:r,applyRecord:i,createRecord:l,handleChange:a}=t.current;if(n&&(0===n.indexOf("format")||Ml.has(n)))return void i(r.current);const s=l(),{start:c,activeFormats:u=[]}=r.current,d=function(e){let{value:t,start:n,end:r,formats:o}=e;const i=Math.min(n,r),l=Math.max(n,r),a=t.formats[i-1]||[],s=t.formats[l]||[];for(t.activeFormats=o.map(((e,t)=>{if(a[t]){if(yi(e,a[t]))return a[t]}else if(s[t]&&yi(e,s[t]))return s[t];return e}));--r>=n;)t.activeFormats.length>0?t.formats[r]=t.activeFormats:delete t.formats[r];return t}({value:s,start:c,end:s.start,formats:u});a(d)}function l(){const{record:l,applyRecord:a,createRecord:s,onSelectionChange:c}=t.current;if("true"!==e.contentEditable)return;if(n.activeElement!==e){if("true"!==n.activeElement.contentEditable)return;if(!n.activeElement.contains(e))return;const t=r.getSelection(),{anchorNode:o,focusNode:i}=t;if(e.contains(o)&&e!==o&&e.contains(i)&&e!==i){const{start:e,end:t}=s();l.current.activeFormats=Ol,c(e,t)}else if(e.contains(o)&&e!==o){const{start:e,end:t=e}=s();l.current.activeFormats=Ol,c(t)}else if(e.contains(i)){const{start:e,end:t=e}=s();l.current.activeFormats=Ol,c(void 0,t)}return}if(o)return;const{start:u,end:d,text:p}=s(),m=l.current;if(p!==m.text)return void i();if(u===m.start&&d===m.end)return void(0===m.text.length&&0===u&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(Zl)&&t.collapseToStart()}(r));const f={...m,start:u,end:d,activeFormats:m._newActiveFormats,_newActiveFormats:void 0},h=Mi(f,Ol);f.activeFormats=h,l.current=f,a(f,{domOnly:!0}),c(u,d)}function a(){var t;o=!0,n.removeEventListener("selectionchange",l),null===(t=e.querySelector(`[${Zl}]`))||void 0===t||t.remove()}function s(){o=!1,i({inputType:"insertText"}),n.addEventListener("selectionchange",l)}function c(){const{record:n,isSelected:r,onSelectionChange:o,applyRecord:i}=t.current;if(!e.parentElement.closest('[contenteditable="true"]'))if(r)i(n.current),o(n.current.start,n.current.end);else{const e=void 0;n.current={...n.current,start:e,end:e,activeFormats:Ol}}}return e.addEventListener("input",i),e.addEventListener("compositionstart",a),e.addEventListener("compositionend",s),e.addEventListener("focus",c),n.addEventListener("selectionchange",l),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionstart",a),e.removeEventListener("compositionend",s),e.removeEventListener("focus",c),n.removeEventListener("selectionchange",l)}}),[])}function jl(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{replacements:n,text:r,start:o,end:i}=e,l=ji(e);let a,s=o-1,c=l?o-1:o,u=i;if(t||(s=i,c=o,u=l?i+1:i),r[s]===Ci){if(l&&n[s]&&n[s].length){const t=n.slice();t[s]=n[s].slice(0,-1),a={...e,replacements:t}}else a=Gi(e,c,u);return a}}function zl(e){const t=(0,v.useRef)(e);return t.current=e,(0,bl.Z)((e=>{function n(e){const{keyCode:n}=e,{createRecord:r,handleChange:o,multilineTag:i}=t.current;if(e.defaultPrevented)return;if(n!==Al.DELETE&&n!==Al.BACKSPACE)return;const l=r(),{start:a,end:s,text:c}=l,u=n===Al.BACKSPACE;if(0===a&&0!==s&&s===c.length)return o(Gi(l)),void e.preventDefault();if(i){let t;t=u&&0===l.start&&0===l.end&&Hi(l)?jl(l,!u):jl(l,u),t&&(o(t),e.preventDefault())}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function Hl(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:r}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:r}}const Vl=(e,t,n)=>(r,o)=>{let i,l;if("function"==typeof e?(i=e(r),l=e(o)):(i=r[e],l=o[e]),i>l)return"asc"===n?1:-1;if(l>i)return"asc"===n?-1:1;const a=t.findIndex((e=>e===r)),s=t.findIndex((e=>e===o));return a>s?1:s>a?-1:0};function Wl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";return e.concat().sort(Vl(t,e,n))}const $l=[],Ul=new Set;function Gl(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==ci.Z.OS&&(null==n?void 0:n.name)===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`core/social-link-${o}`:r}return n?n.name:null}function ql(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Kl(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Yl(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const Xl=(0,Xe.Z)(((e,t)=>e.blocks.byClientId.has(t)?{...e.blocks.byClientId.get(t),attributes:Kl(e,t)}:null),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function Jl(e,t){var n;const r=t&&Us(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree.get(r))||void 0===n?void 0:n.innerBlocks)||$l}const Ql=(0,Xe.Z)(((e,t)=>({clientId:t,innerBlocks:ea(e,t)})),(e=>[e.blocks.order])),ea=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return ja(e,t).map((t=>Ql(e,t)))}),(e=>[e.blocks.order])),ta=(0,Xe.Z)(((e,t)=>{const n=[];for(const r of t)for(const t of ja(e,r))n.push(t,...ta(e,[t]));return n}),(e=>[e.blocks.order])),na=(0,Xe.Z)((e=>{const t=[];for(const n of ja(e))t.push(n,...ta(e,[n]));return t}),(e=>[e.blocks.order])),ra=(0,Xe.Z)(((e,t)=>{const n=na(e);return t?n.reduce(((n,r)=>e.blocks.byClientId.get(r).name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),oa=(0,Xe.Z)(((e,t)=>{if(!t)return $l;const n=na(e).filter((n=>e.blocks.byClientId.get(n).name===t));return n.length>0?n:$l}),(e=>[e.blocks.order,e.blocks.byClientId])),ia=(0,Xe.Z)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>Yl(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),la=(0,Xe.Z)(((e,t)=>ia(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>ia(e,t)));function aa(e,t){return ja(e,t).length}function sa(e){return e.selection.selectionStart}function ca(e){return e.selection.selectionEnd}function ua(e){return e.selection.selectionStart.clientId}function da(e){return e.selection.selectionEnd.clientId}function pa(e){return Sa(e).length||(e.selection.selectionStart.clientId?1:0)}function ma(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function fa(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function ha(e){const t=fa(e);return t?Yl(e,t):null}function ga(e,t){return e.blocks.parents.has(t)?e.blocks.parents.get(t):null}const va=(0,Xe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=t;for(;e.blocks.parents.get(o);)o=e.blocks.parents.get(o),r.push(o);return r.length?n?r:r.reverse():$l}),(e=>[e.blocks.parents])),ba=(0,Xe.Z)((function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=va(e,t,r);return o.map((t=>({id:t,name:Gl(e,t)}))).filter((e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})).map((e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ya(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function _a(e,t){const n=fa(e),r=[...va(e,t),t],o=[...va(e,n),n];let i;const l=Math.min(r.length,o.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=fa(e)),void 0===t&&(t=n<0?Ta(e):Na(e)),!t)return null;const r=ga(e,t);if(null===r)return null;const{order:o}=e.blocks,i=o.get(r),l=i.indexOf(t),a=l+1*n;return a<0||a===i.length?null:i[a]}function xa(e,t){return ka(e,t,-1)}function wa(e,t){return ka(e,t,1)}function Ca(e){return e.initialPosition}const Ea=(0,Xe.Z)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return $l;if(t.clientId===n.clientId)return[t.clientId];const r=ga(e,t.clientId);if(null===r)return $l;const o=ja(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId);return i>l?o.slice(l,i+1):o.slice(i,l+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Sa(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?$l:Ea(e)}const Ia=(0,Xe.Z)((e=>{const t=Sa(e);return t.length?t.map((t=>Yl(e,t))):$l}),(e=>[...Ea.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ta(e){return Sa(e)[0]||null}function Na(e){const t=Sa(e);return t[t.length-1]||null}function Ba(e,t){return Ta(e)===t}function La(e,t){return-1!==Sa(e).indexOf(t)}const Pa=(0,Xe.Z)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=ga(e,n),r=La(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Aa(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Da(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ra(e){const t=sa(e),n=ca(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ma(e){const t=sa(e),n=ca(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Oa(e){return Ea(e).some((t=>!pe(Gl(e,t)).merge))}function Za(e,t){const n=sa(e),r=ca(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=ga(e,n.clientId);if(o!==ga(e,r.clientId))return!1;const i=ja(e,o);let l,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(l=r,a=n):(l=n,a=r);const s=t?a.clientId:l.clientId,c=t?l.clientId:a.clientId,u=Gl(e,s);if(!pe(u).merge)return!1;const d=Yl(e,c);if(d.name===u)return!0;const p=Pe(d,u);return p&&p.length}const Fa=e=>{const t=sa(e),n=ca(e);if(t.clientId===n.clientId)return $l;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return $l;const r=ga(e,t.clientId);if(r!==ga(e,n.clientId))return $l;const o=ja(e,r),i=o.indexOf(t.clientId),l=o.indexOf(n.clientId),[a,s]=i>l?[n,t]:[t,n],c=Yl(e,a.clientId),u=pe(c.name),d=Yl(e,s.clientId),p=pe(d.name),m=c.attributes[a.attributeKey],f=d.attributes[s.attributeKey],h=u.attributes[a.attributeKey],g=p.attributes[s.attributeKey];let v=Ii({html:m,...Hl(h)}),b=Ii({html:f,...Hl(g)});return v=Gi(v,0,a.offset),b=Gi(b,s.offset,b.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:rl({value:v,...Hl(h)})}},{...d,attributes:{...d.attributes,[s.attributeKey]:rl({value:b,...Hl(g)})}}]};function ja(e,t){return e.blocks.order.get(t||"")||$l}function za(e,t){return ja(e,ga(e,t)).indexOf(t)}function Ha(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function Va(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ja(e,t).some((t=>Ha(e,t)||La(e,t)||n&&Va(e,t,n)))}function Wa(e,t){if(!t)return!1;const n=Sa(e),r=n.indexOf(t);return r>-1&&rJa(e,t)))}function es(){return(0,St.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const ts=(0,Xe.Z)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=ga(e,i)||void 0,n=za(e,o.clientId)+1):n=ja(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function ns(e){return null!==e.insertionPoint}function rs(e){return e.template.isValid}function os(e){return e.settings.template}function is(e,t){var n,r,o;return t?null!==(n=null===(r=As(e,t))||void 0===r?void 0:r.templateLock)&&void 0!==n&&n:null!==(o=e.settings.templateLock)&&void 0!==o&&o}const ls=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},as=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=pe(t),!n)return!1;const{allowedBlockTypes:o}=Ds(e),i=ls(o,t,!0);if(!i)return!1;const l=!!is(e,r);if(l)return!1;const a=As(e,r);if(r&&void 0===a)return!1;const s=null==a?void 0:a.allowedBlocks,c=ls(s,t),u=n.parent,d=Gl(e,r),p=ls(u,d);let m=!0;const f=n.ancestor;f&&(m=[r,...va(e,r)].some((t=>ls(f,Gl(e,t)))));const h=m&&(null===c&&null===p||!0===c||!0===p);return h?(0,_e.O)("blockEditor.__unstableCanInsertBlockType",h,n,r,{getBlock:Yl.bind(null,e),getBlockParentsByBlockName:ba.bind(null,e)}):h},ss=(0,Xe.Z)(as,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId.get(n),e.settings.allowedBlockTypes,e.settings.templateLock]));function cs(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ss(e,Gl(e,t),n)))}function us(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Kl(e,t);if(null===r)return!0;const{lock:o}=r,i=!!is(e,n);return void 0===o||void 0===(null==o?void 0:o.remove)?!i:!(null!=o&&o.remove)}function ds(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>us(e,t,n)))}function ps(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=Kl(e,t);if(null===r)return;const{lock:o}=r,i="all"===is(e,n);return void 0===o||void 0===(null==o?void 0:o.move)?!i:!(null!=o&&o.move)}function ms(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ps(e,t,n)))}function fs(e,t){const n=Kl(e,t);if(null===n)return!0;const{lock:r}=n;return!(null!=r&&r.edit)}function hs(e,t){var n;return!!he(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function gs(e,t){var n,r;return null!==(n=null===(r=e.preferences.insertUsage)||void 0===r?void 0:r[t])&&void 0!==n?n:null}const vs=(e,t,n)=>!!he(t,"inserter",!0)&&as(e,t.name,n),bs=(e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=gs(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ys(o,i)}},ys=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},_s=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const r=t.name;let o=!1;he(t.name,"multiple",!0)||(o=ia(e,na(e)).some((e=>{let{name:n}=e;return n===t.name})));const{time:i,count:l=0}=gs(e,r)||{},a={id:r,name:t.name,title:t.title,icon:t.icon,isDisabled:o,frecency:ys(i,l)};if("transform"===n)return a;const s=be(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:s,example:t.example,utility:1}}},ks=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=_s(e,{buildScope:"inserter"}),r=/^\s*)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,o=t=>{let n=ui.Z;if("web"===ci.Z.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(r);if(e){const[,,t="core/",r]=e,o=pe(t+r);o&&(n=o.icon)}}const o=`core/block/${t.id}`,{time:i,count:l=0}=gs(e,o)||{},a=ys(i,l);return{id:o,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:a}},i=me().filter((n=>vs(e,n,t))).map(n),l=as(e,"core/block",t)?js(e).map(o):[],a=i.reduce(((t,n)=>{const{variations:r=[]}=n;if(r.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),r.length){const o=bs(e,n);t.push(...r.map(o))}return t}),[]),s=(e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e},{core:c,noncore:u}=a.reduce(s,{core:[],noncore:[]}),d=[...c,...u];return[...d,...l]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,js(e),me()])),xs=(0,Xe.Z)((function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=Array.isArray(t)?t:[t],[i]=o,l=_s(e,{buildScope:"transform"}),a=me().filter((t=>vs(e,t,r))).map(l),s=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));s["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,N.__)("Unwrap"),icon:null===(n=s[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const c=Te(o).reduce(((e,t)=>("*"===t?e.push(s["*"]):s[null==t?void 0:t.name]&&e.push(s[t.name]),e)),[]);return Wl(c,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,me()])),ws=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=me().some((n=>vs(e,n,t)));if(n)return!0;const r=as(e,"core/block",t)&&js(e).length>0;return r}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,js(e),me()])),Cs=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return me().filter((n=>vs(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,me()])),Es=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(0,St.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Cs(e,t)}),((e,t)=>[...Cs.getDependants(e,t)])),Ss=(0,Xe.Z)((function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!r)return;const o=null===(t=e.blockListSettings[r])||void 0===t?void 0:t.__experimentalDefaultBlock,i=null===(n=e.blockListSettings[r])||void 0===n?void 0:n.__experimentalDirectInsert;return o&&i?"function"==typeof i?i(Yl(e,r))?o:null:o:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree.get(t)])),Is=(0,Xe.Z)(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:Br(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),Ts=(0,Xe.Z)((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Ds(e),r=t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return Is(e,n)})),o=r.filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var r;const e=n.shift();if(!ls(t,e.name||e.blockName,!0))return!1;null===(r=e.innerBlocks)||void 0===r||r.forEach((e=>{n.push(e)}))}return!0})(t,n)}));return o}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Ns=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Ts(e),r=n.filter((n=>{let{blocks:r}=n;return r.every((n=>{let{name:r}=n;return ss(e,r,t)}))}));return r}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId.get(t)])),Bs=(0,Xe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return $l;const r=Ns(e,n),o=Array.isArray(t)?t:[t],i=r.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>o.includes(e)))}));return 0===i.length?$l:i}),((e,t,n)=>[...Ns.getDependants(e,n)])),Ls=(0,Xe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,St.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),Bs(e,t,n)}),((e,t,n)=>[...Ns.getDependants(e,n)])),Ps=(0,Xe.Z)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return $l;if(t.some((t=>{let{clientId:n,innerBlocks:r}=t;return r.length||Us(e,n)})))return $l;const r=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Bs(e,r,n)}),((e,t,n)=>[...Bs.getDependants(e,n)]));function As(e,t){return e.blockListSettings[t]}function Ds(e){return e.settings}function Rs(e){return e.blocks.isPersistentChange}const Ms=(0,Xe.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Os=(0,Xe.Z)(((e,t)=>{var n;const r=js(e).find((e=>e.id===t));return r?null===(n=r.title)||void 0===n?void 0:n.raw:null}),(e=>[js(e)]));function Zs(e){return e.blocks.isIgnoredChange}function Fs(e){return e.lastBlockAttributesChange}function js(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:$l}function zs(e){return"navigation"===e.editorMode}function Hs(e){return e.editorMode}function Vs(e){return e.hasBlockMovingClientId}function Ws(e){return!!e.automaticChangeStatus}function $s(e,t){return e.highlightedBlock===t}function Us(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Gs=(0,Xe.Z)(((e,t)=>{if(!t.length)return null;const n=fa(e);if(t.includes(Gl(e,n)))return n;const r=Sa(e),o=ba(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function qs(e,t,n){var r;const{lastBlockInserted:o}=e;return(null===(r=o.clientIds)||void 0===r?void 0:r.includes(t))&&o.source===n}function Ks(e,t){var n,r;return null===(n=null===(r=e.blockVisibility)||void 0===r?void 0:r[t])||void 0===n||n}const Ys=(0,Xe.Z)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?Ul:t}),(e=>[e.blockVisibility])),Xs=(0,Xe.Z)(((e,t)=>{let n,r=t;for(;e.blocks.parents.has(r);)r=e.blocks.parents.get(r),r&&"contentOnly"===is(e,r)&&(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function Js(e){return e.temporarilyEditingAsBlocks}function Qs(e,t){if(!fs(e,t))return!0;const n=Hs(e);if("zoom-out"===n&&t&&!ga(e,t))return!0;const r=he(Gl(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&Us(e,t))&&!Ha(e,t)&&!Va(e,t,!0)}function ec(e,t){let n=e.blocks.parents[t];for(;n;){if(Qs(e,n))return!0;n=e.blocks.parents[n]}return!1}const tc=["inserterMediaCategories","blockInspectorAnimation"];function nc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e;if(t&&"web"===ci.Z.OS){n={};for(const t in e)tc.includes(t)||(n[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:n}}function rc(){return{type:"HIDE_BLOCK_INTERFACE"}}function oc(){return{type:"SHOW_BLOCK_INTERFACE"}}function ic(e){return e.isBlockInterfaceHidden}function lc(e){var t;return null==e||null===(t=e.lastBlockInserted)||void 0===t?void 0:t.clientIds}const ac="†";function sc(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(ac)}))}const cc=e=>Array.isArray(e)?e:[e],uc=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(dc(e))},dc=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getTemplate(),i=n.getTemplateLock(),l=!o||"all"!==i||Bo(e,o);if(l!==n.isValidTemplate())return r.setTemplateValidity(l),l};function pc(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function mc(e){return(0,St.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function fc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:cc(e),attributes:t,uniqueByBlock:n}}function hc(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function gc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const vc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{select:r,dispatch:o}=n;const i=r.getPreviousBlockClientId(e);if(i)o.selectBlock(i,-1);else if(t){const t=r.getBlockRootClientId(e);t&&o.selectBlock(t,-1)}}},bc=e=>t=>{let{select:n,dispatch:r}=t;const o=n.getNextBlockClientId(e);o&&r.selectBlock(o)};function yc(){return{type:"START_MULTI_SELECT"}}function _c(){return{type:"STOP_MULTI_SELECT"}}const kc=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return r=>{let{select:o,dispatch:i}=r;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;i({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const l=o.getSelectedBlockCount();(0,fl.D)((0,N.sprintf)((0,N._n)("%s block selected.","%s blocks selected.",l),l),"assertive")}};function xc(){return{type:"CLEAR_SELECTED_BLOCK"}}function wc(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Cc(e,t){var n,r;const o=null!==(n=null==t||null===(r=t.__experimentalPreferredStyleVariations)||void 0===r?void 0:r.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!he(n,"defaultStylePicker",!0))return e;if(!o[n])return e;const r=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=r&&r.includes("is-style-"))return e;const{attributes:i={}}=e,l=o[n];return{...e,attributes:{...i,className:`${r||""} is-style-${l}`.trim()}}}))}const Ec=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0;return i=>{let{select:l,dispatch:a}=i;e=cc(e),t=Cc(cc(t),l.getSettings());const s=l.getBlockRootClientId(e[0]);for(let e=0;e{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()}))}};function Sc(e,t){return Ec(e,t)}const Ic=e=>(t,n)=>r=>{let{select:o,dispatch:i}=r;o.canMoveBlocks(t,n)&&i({type:e,clientIds:cc(t),rootClientId:n})},Tc=Ic("MOVE_BLOCKS_DOWN"),Nc=Ic("MOVE_BLOCKS_UP"),Bc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return o=>{let{select:i,dispatch:l}=o;if(i.canMoveBlocks(e,t)){if(t!==n){if(!i.canRemoveBlocks(e,t))return;if(!i.canInsertBlocks(e,n))return}l({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}}};function Lc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3?arguments[3]:void 0;return Bc([e],t,n,r)}function Pc(e,t,n,r,o){return Ac([e],t,n,r,0,o)}const Ac=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5?arguments[5]:void 0;return l=>{let{select:a,dispatch:s}=l;null!==o&&"object"==typeof o&&(i=o,o=0,(0,St.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Cc(cc(e),a.getSettings());const c=[];for(const t of e)a.canInsertBlockType(t.name,n)&&c.push(t);c.length&&s({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})}};function Dc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:r,operation:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o}}const Rc=()=>e=>{let{select:t,dispatch:n}=e;t.isBlockInsertionPointVisible()&&n({type:"HIDE_INSERTION_POINT"})};function Mc(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Oc=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const r=Lo(t.getBlocks(),t.getTemplate());n.resetBlocks(r)},Zc=e=>t=>{let{registry:n,select:r,dispatch:o}=t;const i=r.getSelectionStart(),l=r.getSelectionEnd();if(i.clientId===l.clientId)return;if(!i.attributeKey||!l.attributeKey||void 0===i.offset||void 0===l.offset)return!1;const a=r.getBlockRootClientId(i.clientId);if(a!==r.getBlockRootClientId(l.clientId))return;const s=r.getBlockOrder(a);let c,u;s.indexOf(i.clientId)>s.indexOf(l.clientId)?(c=l,u=i):(c=i,u=l);const d=e?u:c,p=r.getBlock(d.clientId),m=pe(p.name);if(!m.merge)return;const f=c,h=u,g=r.getBlock(f.clientId),v=pe(g.name),b=r.getBlock(h.clientId),y=pe(b.name),_=g.attributes[f.attributeKey],k=b.attributes[h.attributeKey],x=v.attributes[f.attributeKey],w=y.attributes[h.attributeKey];let C=Ii({html:_,...Hl(x)}),E=Ii({html:k,...Hl(w)});C=Gi(C,f.offset,C.text.length),E=Ui(E,ac,0,h.offset);const S=Ce(g,{[f.attributeKey]:rl({value:C,...Hl(x)})}),I=Ce(b,{[h.attributeKey]:rl({value:E,...Hl(w)})}),T=e?S:I,N=g.name===b.name?[T]:Pe(T,m.name);if(!N||!N.length)return;let B;if(e){const e=N.pop();B=m.merge(e.attributes,I.attributes)}else{const e=N.shift();B=m.merge(S.attributes,e.attributes)}const L=sc(B),P=Ii({html:B[L],...Hl(m.attributes[L])}),A=P.text.indexOf(ac),D=rl({value:Gi(P,A,A+1),...Hl(m.attributes[L])});B[L]=D;const R=r.getSelectedBlockClientIds(),M=[...e?N:[],{...p,attributes:{...p.attributes,...B}},...e?[]:N];n.batch((()=>{o.selectionChange(p.clientId,L,A,A),o.replaceBlocks(R,M,0,r.getSelectedBlocksInitialCaretPosition())}))},Fc=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();if(r.clientId===o.clientId)return;if(!r.attributeKey||!o.attributeKey||void 0===r.offset||void 0===o.offset)return;const i=t.getBlockRootClientId(r.clientId);if(i!==t.getBlockRootClientId(o.clientId))return;const l=t.getBlockOrder(i);let a,s;l.indexOf(r.clientId)>l.indexOf(o.clientId)?(a=o,s=r):(a=r,s=o);const c=a,u=s,d=t.getBlock(c.clientId),p=pe(d.name),m=t.getBlock(u.clientId),f=pe(m.name),h=d.attributes[c.attributeKey],g=m.attributes[u.attributeKey],v=p.attributes[c.attributeKey],b=f.attributes[u.attributeKey];let y=Ii({html:h,...Hl(v)}),_=Ii({html:g,...Hl(b)});y=Gi(y,c.offset,y.text.length),_=Gi(_,0,u.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...d,attributes:{...d.attributes,[c.attributeKey]:rl({value:y,...Hl(v)})}},ke(de()),{...m,attributes:{...m.attributes,[u.attributeKey]:rl({value:_,...Hl(b)})}}],1,t.getSelectedBlocksInitialCaretPosition())},jc=()=>e=>{let{select:t,dispatch:n}=e;const r=t.getSelectionStart(),o=t.getSelectionEnd();n.selectionChange({start:{clientId:r.clientId},end:{clientId:o.clientId}})},zc=(e,t)=>n=>{let{registry:r,select:o,dispatch:i}=n;const l=[e,t];i({type:"MERGE_BLOCKS",blocks:l});const[a,s]=l,c=o.getBlock(a),u=pe(c.name);if(!u)return;const d=o.getBlock(s);if(u&&!u.merge){const e=Pe(d,u.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(c.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(c.clientId):void r.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(s),i.selectBlock(t.innerBlocks[0].clientId)}))}const p=pe(d.name),{clientId:m,attributeKey:f,offset:h}=o.getSelectionStart(),g=(m===a?u:p).attributes[f],v=(m===a||m===s)&&void 0!==f&&void 0!==h&&!!g;g||("number"==typeof f?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof f):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=Ce(c),y=Ce(d);if(v){const e=m===a?b:y,t=Ui(Ii({html:e.attributes[f],...Hl(g)}),ac,h,h);e.attributes[f]=rl({value:t,...Hl(g)})}const _=c.name===d.name?[y]:Pe(y,c.name);if(!_||!_.length)return;const k=u.merge(b.attributes,_[0].attributes);if(v){const e=sc(k),t=Ii({html:k[e],...Hl(u.attributes[e])}),n=t.text.indexOf(ac),r=rl({value:Gi(t,n,n+1),...Hl(u.attributes[e])});k[e]=r,i.selectionChange(c.clientId,e,n,n)}i.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...k}},..._.slice(1)],0)},Hc=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;e=cc(e);const i=r.getBlockRootClientId(e[0]);if(r.canRemoveBlocks(e,i)){if(t){const t=!0;o.selectPreviousBlock(e[0],t)}o({type:"REMOVE_BLOCKS",clientIds:e}),o((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:r}=t.getSettings();r||n.insertDefaultBlock()}))}}};function Vc(e,t){return Hc([e],t)}function Wc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function $c(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Uc(){return{type:"START_TYPING"}}function Gc(){return{type:"STOP_TYPING"}}function qc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Kc(){return{type:"STOP_DRAGGING_BLOCKS"}}function Yc(){return(0,St.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Xc(){return(0,St.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Jc(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const Qc=(e,t,n)=>r=>{let{dispatch:o}=r;const i=de();if(!i)return;const l=ke(i,e);return o.insertBlock(l,n,t)};function eu(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function tu(e){return nc(e,!0)}function nu(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function ru(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function ou(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const iu=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},lu=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n.__unstableSetEditorMode(e?"navigation":"edit")}},au=e=>t=>{let{dispatch:n,select:r}=t;if("zoom-out"===e){const e=r.getBlockSelectionStart();e&&n.selectBlock(r.getBlockHierarchyRootClientId(e))}n({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,fl.D)((0,N.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,fl.D)((0,N.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,fl.D)((0,N.__)("You are currently in zoom-out mode."))},su=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,fl.D)((0,N.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},cu=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:r,dispatch:o}=n;if(!e||!e.length)return;const i=r.getBlocksByClientId(e);if(i.some((e=>!e)))return;const l=i.map((e=>e.name));if(l.some((e=>!he(e,"multiple",!0))))return;const a=r.getBlockRootClientId(e[0]),s=cc(e),c=r.getBlockIndex(s[s.length-1]),u=i.map((e=>we(e)));return o.insertBlocks(u,c+1,a,t),u.length>1&&t&&o.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},uu=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i)},du=e=>t=>{let{select:n,dispatch:r}=t;if(!e)return;const o=n.getBlockRootClientId(e);if(n.getTemplateLock(o))return;const i=n.getBlockIndex(e);return r.insertDefaultBlock({},o,i+1)};function pu(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const mu=e=>async t=>{let{dispatch:n}=t;n(pu(e,!0)),await new Promise((e=>setTimeout(e,150))),n(pu(e,!1))};function fu(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function hu(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function gu(e){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e}}const vu="core/block-editor",{lock:bu,unlock:yu}=(0,qt.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/block-editor"),_u={reducer:si,selectors:s,actions:d},ku=(0,W.Z)(vu,{..._u,persist:["preferences"]}),xu=(0,$.registerStore)(vu,{..._u,persist:["preferences"]});yu(xu).registerPrivateActions(c),yu(xu).registerPrivateSelectors(u);const wu={name:"",isSelected:!1},Cu=(0,v.createContext)(wu),{Provider:Eu}=Cu;function Su(){return(0,v.useContext)(Cu)}function Iu(){const{isSelected:e,clientId:t,name:n}=Su();return(0,E.Z)((r=>{if(e)return!0;const{getBlockName:o,isFirstMultiSelectedBlock:i,getMultiSelectedBlockClientIds:l}=r(ku);return!!i(t)&&l().every((e=>o(e)===n))}),[t,e,n])}function Tu(e){let{group:t="default",controls:n,children:r,__experimentalShareWithChildBlocks:o=!1}=e;const i=function(e,t){const n=Iu(),{clientId:r}=Su(),o=(0,E.Z)((e=>{const{getBlockName:n,hasSelectedInnerBlock:o}=e(ku),{hasBlockSupport:i}=e(Xt);return t&&i(n(r),"__experimentalExposeControlsToChildren",!1)&&o(r)}),[t,r]);var i;return n?null===(i=Wo[e])||void 0===i?void 0:i.Fill:o?Wo.parent.Fill:null}(t,o);return i?(0,v.createElement)(Do.Z,{document:document},(0,v.createElement)(i,null,(e=>{const o=(0,U.isEmpty)(e)?null:e;return(0,v.createElement)(Ro.Z.Provider,{value:o},"default"===t&&(0,v.createElement)(Vo,{controls:n}),r)}))):null}var Nu=n(5784),Bu=n(33663);function Lu(e){const t=(0,v.useContext)(Bu.Z);return(0,Nu.RK)(t.fills,{sync:!0}).get(e)}function Pu(e){let{group:t="default",...n}=e;const r=(0,v.useContext)(Ro.Z),o=Wo[t].Slot,i=Lu(o.__unstableName);return Boolean(i&&i.length)?"default"===t?(0,v.createElement)(o,(0,Po.Z)({},n,{bubblesVirtually:!0,fillProps:r})):(0,v.createElement)(Vo,null,(0,v.createElement)(o,(0,Po.Z)({},n,{bubblesVirtually:!0,fillProps:r}))):null}const Au=Tu;Au.Slot=Pu;const Du=e=>(0,v.createElement)(Tu,(0,Po.Z)({group:"inline"},e));Du.Slot=e=>(0,v.createElement)(Pu,(0,Po.Z)({group:"inline"},e));var Ru=Au,Mu=(0,v.forwardRef)((function(e,t){return(0,v.useContext)(Ro.Z)?(0,v.createElement)(Oo.Z,(0,Po.Z)({ref:t},e.toggleProps),(t=>(0,v.createElement)(zo.Z,(0,Po.Z)({},e,{popoverProps:{variant:"toolbar",...e.popoverProps},toggleProps:t})))):(0,v.createElement)(zo.Z,e)})),Ou=n(66426),Zu=n(32828),Fu=n(19542),ju=n(18316),zu=n(80914),Hu=n(13097),Vu=n(3946),Wu=n(27121),$u=n(75104),Uu=n(4723),Gu=n(34109),qu=n(51684),Ku=n(14102),Yu=n(31939),Xu=n(46785),Ju=n(20101),Qu=n(75351),ed=n(66313),td=n(52634);function nd(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transition";switch(t){case"transition":e="transition-duration: 0ms;";break;case"animation":e="animation-duration: 1ms;";break;default:e="\n\t\t\t\tanimation-duration: 1ms;\n\t\t\t\ttransition-duration: 0ms;\n\t\t\t"}return`\n\t\t@media ( prefers-reduced-motion: reduce ) {\n\t\t\t${e};\n\t\t}\n\t`}const rd={name:"7whenc",styles:"display:flex;width:100%"},od=(0,Ju.Z)("div",{target:"eakva831"})("background:",ed.D.gray[900],";border-radius:",td.Z.controlBorderRadius,";left:0;position:absolute;top:2px;bottom:2px;transition:transform ",td.Z.transitionDurationFast," ease;",nd("transition")," z-index:1;"),id=(0,Ju.Z)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var ld=n(4466),ad=n(13714);function sd(e,t){const n=(0,v.useRef)(null),r=(0,v.useRef)(null),o=(0,v.useRef)(),i=(0,v.useCallback)((()=>{let l=null;n.current?l=n.current:t&&(l=t instanceof HTMLElement?t:t.current),r.current&&r.current.element===l&&r.current.reporter===i||(o.current&&(o.current(),o.current=null),r.current={reporter:i,element:l},l&&(o.current=e(l)))}),[t,e]);return(0,v.useEffect)((()=>{i()}),[i]),(0,v.useCallback)((e=>{n.current=e,i()}),[i])}const cd=(e,t,n)=>e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0;function ud(){const{ref:e,width:t,height:n}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.onResize,n=(0,v.useRef)(void 0);n.current=t;const r=e.round||Math.round,o=(0,v.useRef)(),[i,l]=(0,v.useState)({width:void 0,height:void 0}),a=(0,v.useRef)(!1);(0,v.useEffect)((()=>(a.current=!1,()=>{a.current=!0})),[]);const s=(0,v.useRef)({width:void 0,height:void 0}),c=sd((0,v.useCallback)((t=>(o.current&&o.current.box===e.box&&o.current.round===r||(o.current={box:e.box,round:r,instance:new ResizeObserver((t=>{const o=t[0];let i="borderBoxSize";i="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize";const c=cd(o,i,"inlineSize"),u=cd(o,i,"blockSize"),d=c?r(c):void 0,p=u?r(u):void 0;if(s.current.width!==d||s.current.height!==p){const e={width:d,height:p};s.current.width=d,s.current.height=p,n.current?n.current(e):a.current||l(e)}}))}),o.current.instance.observe(t,{box:e.box}),()=>{o.current&&o.current.instance.unobserve(t)})),[e.box,r]),e.ref);return(0,v.useMemo)((()=>({ref:c,width:i.width,height:i.height})),[c,i?i.width:null,i?i.height:null])}(),r=(0,v.useMemo)((()=>({width:null!=t?t:null,height:null!=n?n:null})),[t,n]);return[(0,v.createElement)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:0,overflow:"hidden",zIndex:-1},"aria-hidden":"true",ref:e}),r]}var dd=n(40618),pd=n(55703),md=n(9113),fd=(0,v.memo)((function(e){let{containerRef:t,containerWidth:n,isAdaptiveWidth:r,state:o}=e;const[i,l]=(0,v.useState)(0),[a,s]=(0,v.useState)(0),[c,u]=(0,v.useState)(!1),[d,p]=(0,v.useState)(!1);return(0,v.useEffect)((()=>{const e=null==t?void 0:t.current;if(!e)return;const n=e.querySelector(`[data-value="${o}"]`);if(p(!!n),!n)return;const r=window.setTimeout((()=>{const{width:t,x:r}=n.getBoundingClientRect(),{x:o}=e.getBoundingClientRect();l(r-o-1),s(t)}),100);let i;return c||(i=window.requestAnimationFrame((()=>{u(!0)}))),()=>{window.clearTimeout(r),window.cancelAnimationFrame(i)}}),[c,t,n,o,r]),d?(0,v.createElement)(od,{role:"presentation",style:{transform:`translateX(${i}px)`,transition:c?void 0:"none",width:a}}):null}));const hd=(0,v.createContext)({});var gd=hd,vd=n(44122);const bd=(0,v.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:a,...s}=e;const c=(0,v.useRef)(),[u,d]=ud(),p=(0,dd.Z)(bd,"toggle-group-control-as-radio-group").toString(),m=(0,ld.i)({baseId:p,state:a}),f=(0,pd.Z)(a);return(0,vd.Z)((()=>{f!==m.state&&i(m.state)}),[m.state]),(0,vd.Z)((()=>{a!==m.state&&m.setState(a)}),[a]),(0,v.createElement)(gd.Provider,{value:{...m,isBlock:!r,size:l}},(0,v.createElement)(ad.E,(0,Po.Z)({},m,{"aria-label":o,as:md.Z},s,{ref:(0,vl.Z)([c,t])}),u,(0,v.createElement)(fd,{state:m.state,containerRef:c,containerWidth:d.width,isAdaptiveWidth:r}),n))})),yd=(0,v.forwardRef)((function(e,t){let{children:n,isAdaptiveWidth:r,label:o,onChange:i,size:l,value:a,...s}=e;const c=(0,v.useRef)(),[u,d]=ud(),p=(0,dd.Z)(yd,"toggle-group-control-as-button-group").toString(),[m,f]=(0,v.useState)(a),h={baseId:p,state:m,setState:f},g=(0,pd.Z)(a);return(0,vd.Z)((()=>{g!==h.state&&i(h.state)}),[h.state]),(0,vd.Z)((()=>{a!==h.state&&h.setState(a)}),[a]),(0,v.createElement)(gd.Provider,{value:{...h,isBlock:!r,isDeselectable:!0,size:l}},(0,v.createElement)(md.Z,(0,Po.Z)({"aria-label":o},s,{ref:(0,vl.Z)([c,t]),role:"group"}),u,(0,v.createElement)(fd,{state:h.state,containerRef:c,containerWidth:d.width,isAdaptiveWidth:r}),n))})),_d=()=>{},kd=(0,Ku.Iq)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,isAdaptiveWidth:o=!1,isBlock:i=!1,isDeselectable:l=!1,label:a,hideLabelFromVision:s=!1,help:c,onChange:u=_d,size:d="default",value:p,children:m,...f}=(0,qu.y)(e,"ToggleGroupControl"),h=(0,Yu.I)(),g=(0,v.useMemo)((()=>h((e=>{let{isBlock:t,isDeselectable:n,size:r}=e;return(0,Qu.iv)("background:",ed.D.ui.background,";border:1px solid transparent;border-radius:",td.Z.controlBorderRadius,";display:inline-flex;min-width:0;padding:2px;position:relative;transition:transform ",td.Z.transitionDurationFastest," linear;",nd("transition")," ",(e=>(0,Qu.iv)("min-height:",{default:"36px","__unstable-large":"40px"}[e],";",""))(r)," ",!n&&(e=>{const t=(0,Qu.iv)("border-color:",ed.D.ui.border,";","");return(0,Qu.iv)(e&&t," &:hover{border-color:",ed.D.ui.borderHover,";}&:focus-within{border-color:",ed.D.ui.borderFocus,";box-shadow:",td.Z.controlBoxShadowFocus,";outline:none;z-index:1;}","")})(t),";","")})({isBlock:i,isDeselectable:l,size:d}),i&&rd,r)),[r,h,i,l,d]),b=l?yd:bd;return(0,v.createElement)(Xu.ZP,{help:c,__nextHasNoMarginBottom:n},!s&&(0,v.createElement)(id,null,(0,v.createElement)(Xu.ZP.VisualLabel,null,a)),(0,v.createElement)(b,(0,Po.Z)({},f,{children:m,className:g,isAdaptiveWidth:o,label:a,onChange:u,ref:t,size:d,value:p})))}),"ToggleGroupControl");var xd=kd,wd=n(19695);const Cd=(0,Ju.Z)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),Ed={name:"82a6rk",styles:"flex:1"},Sd=e=>{let{isDeselectable:t,isIcon:n,isPressed:r,size:o}=e;return(0,Qu.iv)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",td.Z.controlBorderRadius,";color:",ed.D.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;transition:background ",td.Z.transitionDurationFast," linear,color ",td.Z.transitionDurationFast," linear,font-weight 60ms linear;",nd("transition")," user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",td.Z.toggleGroupControlBackgroundColor,";}",t&&Td," ",n&&Bd({size:o})," ",r&&Id,";","")},Id=(0,Qu.iv)("color:",ed.D.white,";&:active{background:transparent;}",""),Td=(0,Qu.iv)("color:",ed.D.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",ed.D.white,",0 0 0 ",td.Z.borderWidthFocus," ",ed.D.ui.theme,";outline:2px solid transparent;}",""),Nd=(0,Ju.Z)("div",{target:"et6ln9s0"})("display:flex;font-size:",td.Z.fontSize,";line-height:1;"),Bd=e=>{let{size:t="default"}=e;return(0,Qu.iv)("color:",ed.D.gray[900],";width:",{default:"30px","__unstable-large":"34px"}[t],";padding-left:0;padding-right:0;","")};var Ld=n(19967);const{ButtonContentView:Pd,LabelView:Ad}=p,Dd=e=>{let{showTooltip:t,text:n,children:r}=e;return t&&n?(0,v.createElement)(Ld.Z,{text:n,position:"top center"},r):(0,v.createElement)(v.Fragment,null,r)},Rd=(0,Ku.Iq)((function e(t,n){const r=(0,v.useContext)(hd),o=(0,dd.Z)(e,r.baseId||"toggle-group-control-option-base"),i=(0,qu.y)({...t,id:o},"ToggleGroupControlOptionBase"),{isBlock:l=!1,isDeselectable:a=!1,size:s="default",...c}=r,{className:u,isIcon:d=!1,value:p,children:m,showTooltip:f=!1,...h}=i,g=c.state===p,b=(0,Yu.I)(),y=b(l&&Ed),_=b(Sd({isDeselectable:a,isIcon:d,isPressed:g,size:s}),u),k={...h,className:_,"data-value":p,ref:n};return(0,v.createElement)(Ad,{className:y},(0,v.createElement)(Dd,{showTooltip:f,text:h["aria-label"]},a?(0,v.createElement)("button",(0,Po.Z)({},k,{"aria-pressed":g,type:"button",onClick:()=>{a&&g?c.setState(void 0):c.setState(p)}}),(0,v.createElement)(Pd,null,m)):(0,v.createElement)(wd.Y,(0,Po.Z)({},k,c,{as:"button",value:p}),(0,v.createElement)(Pd,null,m))))}),"ToggleGroupControlOptionBase");var Md=Rd,Od=n(28070);const Zd=(0,v.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,v.createElement)(Md,(0,Po.Z)({},o,{isIcon:!0,"aria-label":r,showTooltip:!0,ref:t}),(0,v.createElement)(Od.Z,{icon:n}))}));var Fd=Zd,jd=n(41974);function zd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Hd(e,t,n,r){var o,i;let l="";return null!=t&&null!==(o=t[n])&&void 0!==o&&null!==(i=o.spacingStyles)&&void 0!==i&&i.length&&r&&t[n].spacingStyles.forEach((t=>{l+=`${zd(e,t.selector.trim())} { `,l+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||r}`})).join("; "),l+="; }"})),l}function Vd(e){const{contentSize:t,wideSize:n}=e,r={},o=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return o.test(t)&&(r.none=(0,N.sprintf)((0,N.__)("Max %s wide"),t)),o.test(n)&&(r.wide=(0,N.sprintf)((0,N.__)("Max %s wide"),n)),r}function Wd(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function $d(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Ud(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Gd={all:(0,N.__)("All sides"),top:(0,N.__)("Top"),bottom:(0,N.__)("Bottom"),left:(0,N.__)("Left"),right:(0,N.__)("Right"),mixed:(0,N.__)("Mixed"),vertical:(0,N.__)("Vertical"),horizontal:(0,N.__)("Horizontal")},qd={top:void 0,right:void 0,bottom:void 0,left:void 0},Kd=["top","right","bottom","left"];function Yd(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Xd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kd;return Object.values(e).length>=1&&Object.values(e).length1}function Jd(e){return null!=e&&Object.values(e).filter((e=>!!e)).length>0}function Qd(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function ep(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Qd(e);if(!n)return null;const r=$d(null==n?void 0:n.top)||t,o=$d(null==n?void 0:n.left)||t;return r===o?r:`${r} ${o}`}var tp=n(78360);const np=(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),rp=(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),op=(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),ip=(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})),lp=(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})),ap={top:{icon:op,title:(0,N._x)("Align top","Block vertical alignment setting")},center:{icon:rp,title:(0,N._x)("Align middle","Block vertical alignment setting")},bottom:{icon:np,title:(0,N._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:ip,title:(0,N._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:lp,title:(0,N._x)("Space between","Block vertical alignment setting")}},sp=["top","center","bottom"];var cp=function(e){let{value:t,onChange:n,controls:r=sp,isCollapsed:o=!0,isToolbar:i}=e;const l=ap[t],a=ap.top,s=i?Vo:Mu,c=i?{isCollapsed:o}:{popoverProps:{variant:"toolbar"}};return(0,v.createElement)(s,(0,Po.Z)({icon:l?l.icon:a.icon,label:(0,N._x)("Change vertical alignment","Block vertical alignment setting label"),controls:r.map((e=>{return{...ap[e],isActive:t===e,role:o?"menuitemradio":void 0,onClick:(r=e,()=>n(t===r?void 0:r))};var r}))},c))};const up=e=>(0,v.createElement)(cp,(0,Po.Z)({},e,{isToolbar:!1})),dp=e=>(0,v.createElement)(cp,(0,Po.Z)({},e,{isToolbar:!0})),pp={left:Fu.Z,center:ju.Z,right:zu.Z,"space-between":Hu.Z,stretch:Vu.Z};var mp=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:r,value:o,popoverProps:i,isToolbar:l}=e;const a=e=>{r(e===o?void 0:e)},s=o?pp[o]:pp.left,c=[{name:"left",icon:Fu.Z,title:(0,N.__)("Justify items left"),isActive:"left"===o,onClick:()=>a("left")},{name:"center",icon:ju.Z,title:(0,N.__)("Justify items center"),isActive:"center"===o,onClick:()=>a("center")},{name:"right",icon:zu.Z,title:(0,N.__)("Justify items right"),isActive:"right"===o,onClick:()=>a("right")},{name:"space-between",icon:Hu.Z,title:(0,N.__)("Space between items"),isActive:"space-between"===o,onClick:()=>a("space-between")},{name:"stretch",icon:Vu.Z,title:(0,N.__)("Stretch items"),isActive:"stretch"===o,onClick:()=>a("stretch")}],u=l?Vo:Mu,d=l?{isCollapsed:n}:{};return(0,v.createElement)(u,(0,Po.Z)({icon:s,popoverProps:i,label:(0,N.__)("Change items justification"),controls:c.filter((e=>t.includes(e.name)))},d))};const fp=e=>(0,v.createElement)(mp,(0,Po.Z)({},e,{isToolbar:!1})),hp=["color","border","dimensions","typography","spacing"],gp={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},vp={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function bp(e){const{name:t,clientId:n}=Su();return(0,E.Z)((r=>{if(hp.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o=(0,_e.O)("blockEditor.useSetting.before",void 0,e,n,t);if(void 0!==o)return o;const i=(e=>vp[e]||e)(e),l=[n,...r(ku).getBlockParents(n,!0)];for(const e of l)if(he(r(ku).getBlockName(e),"__experimentalSettings",!1)){var a;const n=r(ku).getBlockAttributes(e);if(o=null!==(a=(0,U.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==a?a:(0,U.get)(n,`settings.${i}`),void 0!==o)break}const s=r(ku).getSettings();if(void 0===o){var c;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;o=null!==(c=(0,U.get)(s,n))&&void 0!==c?c:(0,U.get)(s,e)}var u,d;if(void 0!==o)return te[i]?null!==(u=null!==(d=o.custom)&&void 0!==d?d:o.theme)&&void 0!==u?u:o.default:o;const p=gp[i]?gp[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}const yp=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.fromEntries(Object.entries((0,U.mapValues)(e,yp)).filter((e=>{let[,t]=e;return Boolean(t)})));return(0,U.isEmpty)(t)?void 0:t};function _p(e){return"object"==typeof e?{...Object.fromEntries(Object.entries(e).map((e=>{let[t,n]=e;return[t,_p(n)]})))}:e}function kp(e,t,n){const r=function(e){return Array.isArray(e)?e:"number"==typeof e?[e.toString()]:[e]}(t),o=e?_p(e):{};return r.reduce(((e,t,o)=>(void 0===e[t]&&(e[t]={}),o===r.length-1&&(e[t]=n),e[t])),o),o}function xp(e,t,n,r,o,i){var l;if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let a=null===(l=r[0])||void 0===l?void 0:l.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;var s;a=null===(s=r[o])||void 0===s?void 0:s.attributes}let c=n;return Object.entries(e).forEach((e=>{let[n,r]=e;r&&t[n].forEach((e=>{const t=(0,U.get)(a,e);t&&(c={...c,attributes:kp(c.attributes,e,t)})}))})),c}function wp(e,t,n){const r=fe(e,t),o=null==r?void 0:r.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}function Cp(e,t){const n=bp("typography.fontFamilies"),r=bp("typography.fontSizes"),o=bp("typography.customFontSize"),i=bp("typography.fontStyle"),l=bp("typography.fontWeight"),a=bp("typography.lineHeight"),s=bp("typography.textDecoration"),c=bp("typography.textTransform"),u=bp("typography.letterSpacing"),d=bp("spacing.padding"),p=bp("spacing.margin"),m=bp("spacing.blockGap"),f=bp("spacing.spacingSizes"),h=bp("spacing.units"),g=bp("dimensions.minHeight"),b=bp("layout");return function(e,t,n){const{supportedStyles:r,supports:o}=(0,E.Z)((e=>{var r;return{supportedStyles:yu(e(Xt)).getSupportedStyles(t,n),supports:null===(r=e(Xt).getBlockType(t))||void 0===r?void 0:r.supports}}),[t,n]);return(0,v.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{var n,i,l,a;r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const s=Array.isArray(null==o||null===(n=o.spacing)||void 0===n?void 0:n[e])?null==o||null===(i=o.spacing)||void 0===i?void 0:i[e]:null==o||null===(l=o.spacing)||void 0===l||null===(a=l[e])||void 0===a?void 0:a.sides;var c;null!=s&&s.length&&(t.spacing={...t.spacing,[e]:{...null===(c=t.spacing)||void 0===c?void 0:c[e],sides:s}})})),r.includes("minHeight")||(t.dimensions={...t.dimensions,minHeight:!1}),t}),[e,r,o])}((0,v.useMemo)((()=>({typography:{fontFamilies:{custom:n},fontSizes:{custom:r},customFontSize:o,fontStyle:i,fontWeight:l,lineHeight:a,textDecoration:s,textTransform:c,letterSpacing:u},spacing:{spacingSizes:{custom:f},padding:d,margin:p,blockGap:m,units:h},dimensions:{minHeight:g},layout:b,parentLayout:t})),[n,r,o,i,l,a,s,c,u,d,p,m,f,h,g,b,t]),e)}const Ep={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Sp={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Ip={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Tp=["wrap","nowrap"];var Np={name:"flex",label:(0,N.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r={}}=e;const{allowOrientation:o=!0}=r;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Uu.Z,null,(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Lp,{layout:t,onChange:n})),(0,v.createElement)(Gu.Z,null,o&&(0,v.createElement)(Ap,{layout:t,onChange:n}))),(0,v.createElement)(Pp,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:r}=e;if(null!=r&&r.allowSwitching)return null;const{allowVerticalAlignment:o=!0}=r;return(0,v.createElement)(Ru,{group:"block",__experimentalShareWithChildBlocks:!0},(0,v.createElement)(Lp,{layout:t,onChange:n,isToolbar:!0}),o&&(0,v.createElement)(Bp,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o,style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{orientation:c="horizontal"}=o,u=null!=i&&null!==(t=i.spacing)&&void 0!==t&&t.blockGap&&!wp(l,"spacing","blockGap")?ep(null==i||null===(n=i.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=Ep[o.justifyContent],p=Tp.includes(o.flexWrap)?o.flexWrap:"wrap",m=Ip[o.verticalAlignment],f=Sp[o.justifyContent]||Sp.left;let h="";const g=[];return p&&"wrap"!==p&&g.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&g.push(`align-items: ${m}`),d&&g.push(`justify-content: ${d}`)):(m&&g.push(`justify-content: ${m}`),g.push("flex-direction: column"),g.push(`align-items: ${f}`)),g.length&&(h=`${zd(r)} {\n\t\t\t\t${g.join("; ")};\n\t\t\t}`),a&&u&&(h+=Hd(r,s,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Bp(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{orientation:o="horizontal"}=t,i="horizontal"===o?Ip.center:Ip.top,{verticalAlignment:l=i}=t,a=e=>{n({...t,verticalAlignment:e})};if(r)return(0,v.createElement)(up,{onChange:a,value:l,controls:"horizontal"===o?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const s=[{value:"flex-start",label:(0,N.__)("Align items top")},{value:"center",label:(0,N.__)("Align items center")},{value:"flex-end",label:(0,N.__)("Align items bottom")}];return(0,v.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,v.createElement)("legend",null,(0,N.__)("Vertical alignment")),(0,v.createElement)("div",null,s.map(((e,t,n)=>(0,v.createElement)(Mo.ZP,{key:e,label:n,icon:t,isPressed:l===e,onClick:()=>a(e)})))))}function Lp(e){let{layout:t,onChange:n,isToolbar:r=!1}=e;const{justifyContent:o="left",orientation:i="horizontal"}=t,l=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===i?a.push("space-between"):a.push("stretch"),r)return(0,v.createElement)(fp,{allowedControls:a,value:o,onChange:l,popoverProps:{position:"bottom right",variant:"toolbar"}});const s=[{value:"left",icon:Fu.Z,label:(0,N.__)("Justify items left")},{value:"center",icon:ju.Z,label:(0,N.__)("Justify items center")},{value:"right",icon:zu.Z,label:(0,N.__)("Justify items right")}];return"horizontal"===i?s.push({value:"space-between",icon:Hu.Z,label:(0,N.__)("Space between items")}):s.push({value:"stretch",icon:Vu.Z,label:(0,N.__)("Stretch items")}),(0,v.createElement)(xd,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Justification"),value:o,onChange:l,className:"block-editor-hooks__flex-layout-justification-controls"},s.map((e=>{let{value:t,icon:n,label:r}=e;return(0,v.createElement)(Fd,{key:t,value:t,icon:n,label:r})})))}function Pp(e){let{layout:t,onChange:n}=e;const{flexWrap:r="wrap"}=t;return(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===r})}function Ap(e){let{layout:t,onChange:n}=e;const{orientation:r="horizontal",verticalAlignment:o,justifyContent:i}=t;return(0,v.createElement)(xd,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,N.__)("Orientation"),value:r,onChange:e=>{let r=o,l=i;return"horizontal"===e?("space-between"===o&&(r="center"),"stretch"===i&&(l="left")):("stretch"===o&&(r="top"),"space-between"===i&&(l="left")),n({...t,orientation:e,verticalAlignment:r,justifyContent:l})}},(0,v.createElement)(Fd,{icon:Wu.Z,value:"horizontal",label:(0,N.__)("Horizontal")}),(0,v.createElement)(Fd,{icon:$u.Z,value:"vertical",label:(0,N.__)("Vertical")}))}var Dp={name:"default",label:(0,N.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:r,blockName:o,hasBlockGapSupport:i,layoutDefinitions:l}=e;const a=ep(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap);let s="";wp(o,"spacing","blockGap")||(null!=a&&a.top?s=ep(null==a?void 0:a.top):"string"==typeof a&&(s=ep(a)));let c="";return i&&s&&(c+=Hd(n,l,"default",s)),c},getOrientation:()=>"vertical",getAlignments(e,t){const n=Vd(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}};const Rp="web"===ci.Z.OS,Mp={px:{value:"px",label:Rp?"px":(0,N.__)("Pixels (px)"),a11yLabel:(0,N.__)("Pixels (px)"),step:1},"%":{value:"%",label:Rp?"%":(0,N.__)("Percentage (%)"),a11yLabel:(0,N.__)("Percent (%)"),step:.1},em:{value:"em",label:Rp?"em":(0,N.__)("Relative to parent font size (em)"),a11yLabel:(0,N._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Rp?"rem":(0,N.__)("Relative to root font size (rem)"),a11yLabel:(0,N._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Rp?"vw":(0,N.__)("Viewport width (vw)"),a11yLabel:(0,N.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Rp?"vh":(0,N.__)("Viewport height (vh)"),a11yLabel:(0,N.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Rp?"vmin":(0,N.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,N.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Rp?"vmax":(0,N.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,N.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Rp?"ch":(0,N.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,N.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Rp?"ex":(0,N.__)("x-height of the font (ex)"),a11yLabel:(0,N.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Rp?"cm":(0,N.__)("Centimeters (cm)"),a11yLabel:(0,N.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Rp?"mm":(0,N.__)("Millimeters (mm)"),a11yLabel:(0,N.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Rp?"in":(0,N.__)("Inches (in)"),a11yLabel:(0,N.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Rp?"pc":(0,N.__)("Picas (pc)"),a11yLabel:(0,N.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Rp?"pt":(0,N.__)("Points (pt)"),a11yLabel:(0,N.__)("Points (pt)"),step:1}},Op=Object.values(Mp),Zp=[Mp.px,Mp["%"],Mp.em,Mp.rem,Mp.vw,Mp.vh],Fp=Mp.px;function jp(e,t,n){return Hp(t?`${null!=e?e:""}${t}`:e,n)}function zp(e){return Array.isArray(e)&&!!e.length}function Hp(e){var t,n;let r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Op;if(void 0!==e||null===e){r=`${e}`.trim();const t=parseFloat(r);o=isFinite(t)?t:void 0}const l=null===(t=r)||void 0===t?void 0:t.match(/[\d.\-\+]*\s*(.*)/),a=null==l||null===(n=l[1])||void 0===n?void 0:n.toLowerCase();let s;if(zp(i)){const e=i.find((e=>e.value===a));s=null==e?void 0:e.value}else s=Fp.value;return[o,s]}function Vp(e,t,n,r){const[o,i]=Hp(e,t),l=null!=o?o:n;let a=i||r;return!a&&zp(t)&&(a=t[0].value),[l,a]}const Wp=e=>{let{units:t=Op,availableUnits:n=[],defaultValues:r}=e;const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(n,t);return r&&o.forEach(((e,t)=>{if(r[e.value]){const[n]=Hp(r[e.value]);o[t].default=n}})),o};var $p=n(3435),Up=n(47799),Gp=n(74985),qp=n(47746),Kp=n(17213);const Yp=(0,Ju.Z)(Gp.Z,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",qp.Kg,"{transition:box-shadow 0.1s linear;}}"),Xp=e=>{let{selectSize:t}=e;const n={default:(0,Qu.iv)("box-sizing:border-box;padding:2px 1px;width:20px;color:",ed.D.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),large:(0,Qu.iv)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,Kp.D)(2),";padding:",(0,Kp.D)(1),";color:",ed.D.ui.theme,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")};return"__unstable-large"===t?n.large:n.default},Jp=(0,Ju.Z)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Xp,";color:",ed.D.gray[900],";}"),Qp=(0,Ju.Z)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Xp,";",(e=>{let{selectSize:t="default"}=e;const n={default:(0,Qu.iv)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,Up.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",ed.D.gray[100],";}&:focus{border:1px solid ",ed.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",td.Z.borderWidth+" "+ed.D.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),large:(0,Qu.iv)("display:flex;justify-content:center;align-items:center;&:hover{color:",ed.D.ui.borderFocus,";box-shadow:inset 0 0 0 ",td.Z.borderWidth+" "+ed.D.ui.borderFocus,";outline:",td.Z.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",td.Z.borderWidthFocus+" "+ed.D.ui.borderFocus,";outline:",td.Z.borderWidthFocus," solid transparent;}","")};return"__unstable-large"===t?n.large:n.default}),";&:not( :disabled ){cursor:pointer;}}");function em(e){let{className:t,isUnitSelectTabbable:n=!0,onChange:r,size:o="default",unit:i="px",units:l=Zp,...a}=e;if(!zp(l)||1===(null==l?void 0:l.length))return(0,v.createElement)(Jp,{className:"components-unit-control__unit-label",selectSize:o},i);const s=w()("components-unit-control__select",t);return(0,v.createElement)(Qp,(0,Po.Z)({className:s,onChange:e=>{const{value:t}=e.target,n=l.find((e=>e.value===t));null==r||r(t,{event:e,data:n})},selectSize:o,tabIndex:n?void 0:-1,value:i},a),l.map((e=>(0,v.createElement)("option",{value:e.value,key:e.value},e.label))))}var tm=n(85494);const nm=(0,v.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:a=!1,isPressEnterToChange:s=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:p,onUnitChange:m,size:f="default",unit:h,units:g=Zp,value:b,onBlur:y,onFocus:_,...k}=e;"unit"in e&&(0,St.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const x=null!=b?b:void 0,C=(0,v.useMemo)((()=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Op;const r=Array.isArray(n)?[...n]:[],[,o]=jp(e,t,Op);return o&&!r.some((e=>e.value===o))&&Mp[o]&&r.unshift(Mp[o]),r}(x,h,g)),[x,h,g]),[E,S]=jp(x,h,C),[I,T]=(0,tm.Z)(1===C.length?C[0].value:h,{initial:S,fallback:""});(0,v.useEffect)((()=>{void 0!==S&&T(S)}),[S,T]);const B=(0,v.useRef)(void 0),L=w()("components-unit-control","components-unit-control-wrapper",i),P=e=>{if(!isNaN(Number(e.currentTarget.value)))return void(B.current=void 0);const[t,n]=Vp(e.currentTarget.value,C,E,I);if(B.current=t,s&&n!==I){const t={event:e,data:Array.isArray(C)?C.find((e=>e.value===n)):void 0};null==m||m(n,t),T(n)}},A=(e,t)=>{const n={...e};var r;return t.type===$p.g&&void 0!==B.current&&(n.value=(null!==(r=B.current)&&void 0!==r?r:"").toString(),B.current=void 0),n};let D=A;n&&(D=(e,t)=>{const r=A(e,t);return n(r,t)});const R=a?null:(0,v.createElement)(em,{"aria-label":(0,N.__)("Select unit"),disabled:l,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;c&&void 0!==(null==n?void 0:n.default)&&(r=`${n.default}${e}`),null==p||p(r,t),null==m||m(e,t),T(e)},size:f,unit:I,units:C,onBlur:y,onFocus:_});let M=k.step;if(!M&&C){var O;const e=C.find((e=>e.value===I));M=null!==(O=null==e?void 0:e.step)&&void 0!==O?O:1}return(0,v.createElement)(Yp,(0,Po.Z)({type:s?"text":"number"},k,{autoComplete:r,className:L,disabled:l,spinControls:"none",isPressEnterToChange:s,label:d,onBlur:e=>{P(e),null==y||y(e)},onKeyDown:e=>{const{key:t}=e;"Enter"===t&&P(e)},onChange:(e,t)=>{if(""===e||null==e)return void(null==p||p("",t));const n=Vp(e,C,E,I).join("");null==p||p(n,t)},ref:t,size:f,suffix:R,value:null!=E?E:"",step:M,__unstableStateReducer:D,onFocus:_}))}));var rm=nm,om=n(85180),im=n(83295),lm=n(25538);const am="var:";function sm(e,t,n,r){const o=(0,U.get)(e,n);return o?[{selector:null==t?void 0:t.selector,key:r,value:um(o)}]:[]}function cm(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const i=(0,U.get)(e,n);if(!i)return[];const l=[];if("string"==typeof i)l.push({selector:null==t?void 0:t.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=um((0,U.get)(i,[n]));return o&&e.push({selector:null==t?void 0:t.selector,key:null==r?void 0:r.individual.replace("%s",dm(n)),value:o}),e}),[]);l.push(...e)}return l}function um(e){return"string"==typeof e&&e.startsWith(am)?`var(--wp--${e.slice(am.length).split("|").map((e=>(0,U.kebabCase)(e))).join("--")})`:e}function dm(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function pm(e){return(t,n)=>sm(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(dm).join("")}(e))}function mm(e){return(t,n)=>["color","style","width"].flatMap((r=>pm(["border",e,r])(t,n)))}const fm={name:"radius",generate:(e,t)=>cm(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},hm={name:"background",generate:(e,t)=>sm(e,t,["color","background"],"backgroundColor")},gm={name:"gradient",generate:(e,t)=>sm(e,t,["color","gradient"],"background")},vm={name:"text",generate:(e,t)=>sm(e,t,["color","text"],"color")},bm={name:"minHeight",generate:(e,t)=>sm(e,t,["dimensions","minHeight"],"minHeight")},ym={name:"shadow",generate:(e,t)=>sm(e,t,["shadow"],"boxShadow")},_m={name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","color"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineColor";return sm(e,t,n,r)}},km={name:"offset",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","offset"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineOffset";return sm(e,t,n,r)}},xm={name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","style"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineStyle";return sm(e,t,n,r)}},wm={name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["outline","width"],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"outlineWidth";return sm(e,t,n,r)}},Cm={name:"padding",generate:(e,t)=>cm(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Em={name:"margin",generate:(e,t)=>cm(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Sm={name:"fontSize",generate:(e,t)=>sm(e,t,["typography","fontSize"],"fontSize")},Im={name:"fontStyle",generate:(e,t)=>sm(e,t,["typography","fontStyle"],"fontStyle")},Tm={name:"fontWeight",generate:(e,t)=>sm(e,t,["typography","fontWeight"],"fontWeight")},Nm={name:"fontFamily",generate:(e,t)=>sm(e,t,["typography","fontFamily"],"fontFamily")},Bm={name:"letterSpacing",generate:(e,t)=>sm(e,t,["typography","letterSpacing"],"letterSpacing")},Lm={name:"lineHeight",generate:(e,t)=>sm(e,t,["typography","lineHeight"],"lineHeight")},Pm={name:"textColumns",generate:(e,t)=>sm(e,t,["typography","textColumns"],"columnCount")},Am={name:"textDecoration",generate:(e,t)=>sm(e,t,["typography","textDecoration"],"textDecoration")},Dm={name:"textTransform",generate:(e,t)=>sm(e,t,["typography","textTransform"],"textTransform")},Rm=[{name:"color",generate:pm(["border","color"])},{name:"style",generate:pm(["border","style"])},{name:"width",generate:pm(["border","width"])},fm,{name:"borderTop",generate:mm("top")},{name:"borderRight",generate:mm("right")},{name:"borderBottom",generate:mm("bottom")},{name:"borderLeft",generate:mm("left")},vm,gm,hm,bm,_m,xm,km,wm,Em,Cm,Nm,Sm,Im,Tm,Bm,Lm,Pm,Am,Dm,ym];function Mm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Om(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,U.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const r=(0,U.groupBy)(n,"selector"),o=Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,U.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]);return o.join("\n")}function Om(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[];return Rm.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}var Zm={name:"constrained",label:(0,N.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:r,contentSize:o,justifyContent:i="center"}=t,l=[{value:"left",icon:Fu.Z,label:(0,N.__)("Justify items left")},{value:"center",icon:ju.Z,label:(0,N.__)("Justify items center")},{value:"right",icon:zu.Z,label:(0,N.__)("Justify items right")}],a=Wp({availableUnits:bp("spacing.units")||["%","px","em","rem","vw"]});return(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,v.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,v.createElement)(rm,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,N.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:a}),(0,v.createElement)(om.Z,{icon:im.Z})),(0,v.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,v.createElement)(rm,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,N.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:a}),(0,v.createElement)(om.Z,{icon:lm.Z}))),(0,v.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,N.__)("Customize the width for all elements that are assigned to the center or wide columns.")),(0,v.createElement)(xd,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Justification"),value:i,onChange:e=>{n({...t,justifyContent:e})}},l.map((e=>{let{value:t,icon:n,label:r}=e;return(0,v.createElement)(Fd,{key:t,value:t,icon:n,label:r})}))))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:r,layout:o={},style:i,blockName:l,hasBlockGapSupport:a,layoutDefinitions:s}=e;const{contentSize:c,wideSize:u,justifyContent:d}=o,p=ep(null==i||null===(t=i.spacing)||void 0===t?void 0:t.blockGap);let m="";wp(l,"spacing","blockGap")||(null!=p&&p.top?m=ep(null==p?void 0:p.top):"string"==typeof p&&(m=ep(p)));const f="left"===d?"0 !important":"auto !important",h="right"===d?"0 !important":"auto !important";let g=c||u?`\n\t\t\t\t\t${zd(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: ${f};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${zd(r,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${zd(r,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===d?g+=`${zd(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${f}; }`:"right"===d&&(g+=`${zd(r,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),null!=i&&null!==(n=i.spacing)&&void 0!==n&&n.padding&&Om(i).forEach((e=>{"paddingRight"===e.key?g+=`\n\t\t\t\t\t${zd(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(g+=`\n\t\t\t\t\t${zd(r,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),a&&m&&(g+=Hd(r,s,"constrained",m)),g},getOrientation:()=>"vertical",getAlignments(e){const t=Vd(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}};const Fm=[Dp,Np,Zm];function jm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Fm.find((t=>t.name===e))}const zm={type:"default"},Hm=(0,v.createContext)(zm),Vm=Hm.Provider;function Wm(){return(0,v.useContext)(Hm)}function $m(e){let{layout:t={},css:n,...r}=e;const o=jm(t.type),i=null!==bp("spacing.blockGap");if(o){var l;if(n)return(0,v.createElement)("style",null,n);const e=null===(l=o.getLayoutStyle)||void 0===l?void 0:l.call(o,{hasBlockGapSupport:i,layout:t,...r});if(e)return(0,v.createElement)("style",null,e)}return null}const Um=[],Gm=["none","left","center","right","wide","full"],qm=["wide","full"];function Km(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gm;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n,isBlockBasedTheme:r}=(0,E.Z)((e=>{const{getSettings:t}=e(ku),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout,isBlockBasedTheme:n.__unstableIsBlockBasedTheme}}),[]),o=Wm(),i=jm(null==o?void 0:o.type),l=i.getAlignments(o,r);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?Um:t}if("default"!==i.name&&"constrained"!==i.name)return Um;const{alignments:a=Gm}=o,s=e.filter((e=>(o.alignments||t||!qm.includes(e))&&a.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?Um:s}var Ym=n(12674),Xm=n(17357),Jm=n(27863),Qm=n(94877);const ef={none:{icon:Ym.Z,title:(0,N._x)("None","Alignment option")},left:{icon:Xm.Z,title:(0,N.__)("Align left")},center:{icon:im.Z,title:(0,N.__)("Align center")},right:{icon:Jm.Z,title:(0,N.__)("Align right")},wide:{icon:lm.Z,title:(0,N.__)("Wide width")},full:{icon:Qm.Z,title:(0,N.__)("Full width")}},tf={variant:"toolbar"};var nf=function(e){let{value:t,onChange:n,controls:r,isToolbar:o,isCollapsed:i=!0}=e;const l=Km(r);if(!l.length)return null;function a(e){n([t,"none"].includes(e)?void 0:e)}const s=ef[t],c=ef.none,u=o?Vo:Mu,d={icon:s?s.icon:c.icon,label:(0,N.__)("Align")},p=o?{isCollapsed:i,controls:l.map((e=>{let{name:n}=e;return{...ef[n],isActive:t===n||!t&&"none"===n,role:i?"menuitemradio":void 0,onClick:()=>a(n)}}))}:{toggleProps:{describedBy:(0,N.__)("Change alignment")},popoverProps:tf,children:e=>{let{onClose:n}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ou.Z,{className:"block-editor-block-alignment-control__menu-group"},l.map((e=>{let{name:r,info:o}=e;const{icon:i,title:l}=ef[r],s=r===t||!t&&"none"===r;return(0,v.createElement)(Zu.Z,{key:r,icon:i,iconPosition:"left",className:w()("components-dropdown-menu__menu-item",{"is-active":s}),isSelected:s,onClick:()=>{a(r),n()},role:"menuitemradio",info:o},l)}))))}};return(0,v.createElement)(u,(0,Po.Z)({},d,p))};const rf=e=>(0,v.createElement)(nf,(0,Po.Z)({},e,{isToolbar:!1})),of=["left","center","right","wide","full"],lf=["wide","full"];function af(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?of.filter((t=>e.includes(t))):!0===e?[...of]:[],!r||!0===e&&!n?t.filter((e=>!lf.includes(e))):t}const sf=(0,Ao.o)((e=>t=>{const n=(0,v.createElement)(e,(0,Po.Z)({key:"edit"},t)),{name:r}=t,o=Km(af(fe(r,"align"),he(r,"alignWide",!0))).map((e=>{let{name:t}=e;return t})),i=(0,E.Z)((e=>e(ku).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return!o.length||i?n:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,{group:"block",__experimentalShareWithChildBlocks:!0},(0,v.createElement)(rf,{value:t.attributes.align,onChange:e=>{if(!e){var n,r;const o=pe(t.name);(null==o||null===(n=o.attributes)||void 0===n||null===(r=n.align)||void 0===r?void 0:r.default)&&(e="")}t.setAttributes({align:e})},controls:o})),n)}),"withToolbarControls"),cf=(0,Ao.o)((e=>t=>{const{name:n,attributes:r}=t,{align:o}=r,i=Km(af(fe(n,"align"),he(n,"alignWide",!0)));if(void 0===o)return(0,v.createElement)(e,t);let l=t.wrapperProps;return i.some((e=>e.name===o))&&(l={...l,"data-align":o}),(0,v.createElement)(e,(0,Po.Z)({},t,{wrapperProps:l}))}));(0,_e.KJ)("blocks.registerBlockType","core/align/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.align)&&void 0!==t?t:{})||he(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...of,""]}}),e})),(0,_e.KJ)("editor.BlockListBlock","core/editor/align/with-data-align",cf),(0,_e.KJ)("editor.BlockEdit","core/editor/align/with-toolbar-controls",sf),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:r}=n;return af(fe(t,"align"),he(t,"alignWide",!0)).includes(r)&&(e.className=w()(`align${r}`,e.className)),e})),(0,_e.KJ)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));var uf=n(8902),df=n(94688),pf=n(29813);const mf=()=>{},ff=(0,v.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:mf,deregisterPanelItem:mf,flagItemCustomization:mf,registerResetAllFilter:mf,deregisterResetAllFilter:mf,areAllOptionalControlsHidden:!0}),hf=()=>(0,v.useContext)(ff),gf=(0,I.up)("InspectorControls"),vf=(0,I.up)("InspectorAdvancedControls"),bf=(0,I.up)("InspectorControlsBorder"),yf=(0,I.up)("InspectorControlsColor"),_f=(0,I.up)("InspectorControlsDimensions"),kf=(0,I.up)("InspectorControlsPosition"),xf=(0,I.up)("InspectorControlsTypography");var wf={default:gf,advanced:vf,border:bf,color:yf,dimensions:_f,list:(0,I.up)("InspectorControlsListView"),settings:gf,styles:(0,I.up)("InspectorControlsStyles"),typography:xf,position:kf};function Cf(e){var t;let{children:n,group:r="default",__experimentalGroup:o,resetAllFilter:i}=e;o&&((0,St.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),r=o);const l=Iu(),a=null===(t=wf[r])||void 0===t?void 0:t.Fill;return a?l?(0,v.createElement)(Do.Z,{document:document},(0,v.createElement)(a,null,(e=>(0,v.createElement)(Ef,{fillProps:e,children:n,resetAllFilter:i})))):null:("undefined"!=typeof process&&process.env,null)}function Ef(e){let{children:t,resetAllFilter:n,fillProps:r}=e;const{registerResetAllFilter:o,deregisterResetAllFilter:i}=r;(0,v.useEffect)((()=>(n&&o&&o(n),()=>{n&&i&&i(n)})),[n,o,i]);const l=(0,U.isEmpty)(r)?null:r;return(0,v.createElement)(ff.Provider,{value:l},t)}var Sf=n(96972),If=n(71458),Tf=n(74731),Nf=n(74457),Bf=n(42824),Lf=n(77019),Pf=n(69659);const Af={columns:e=>(0,Qu.iv)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,Qu.iv)("column-gap:",(0,Kp.D)(2),";row-gap:",(0,Kp.D)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},Df={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},Rf=(0,Qu.iv)(Af.item.fullWidth," gap:",(0,Kp.D)(2),";.components-dropdown-menu{margin:",(0,Kp.D)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,Kp.D)(6),";}",""),Mf={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},Of=(0,Qu.iv)(Af.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Pf.im,"{margin-bottom:0;",Pf.ob,":last-child{margin-bottom:0;}}",Pf.vB,"{margin-bottom:0;}&& ",qp.ub,"{label{line-height:1.4em;}}",""),Zf={name:"eivff4",styles:"display:none"},Ff={name:"16gsvie",styles:"min-width:200px"},jf=(0,Ju.Z)("span",{target:"ews648u0"})("color:",ed.D.ui.themeDark10,";font-size:11px;font-weight:500;line-height:1.4;",(0,Up.b)({marginLeft:(0,Kp.D)(3)})," text-transform:uppercase;"),zf=(0,Qu.iv)("color:",ed.D.gray[900],";&&[aria-disabled='true']{color:",ed.D.gray[700],";opacity:1;&:hover{color:",ed.D.gray[700],";}",jf,"{opacity:0.3;}}",""),Hf=e=>{let{itemClassName:t,items:n,toggleItem:r}=e;if(!n.length)return null;const o=(0,v.createElement)(jf,{"aria-hidden":!0},(0,N.__)("Reset"));return(0,v.createElement)(Ou.Z,{label:(0,N.__)("Defaults")},n.map((e=>{let[n,i]=e;return i?(0,v.createElement)(Zu.Z,{key:n,className:t,role:"menuitem",label:(0,N.sprintf)((0,N.__)("Reset %s"),n),onClick:()=>{r(n),(0,fl.D)((0,N.sprintf)((0,N.__)("%s reset to default"),n),"assertive")},suffix:o},n):(0,v.createElement)(Zu.Z,{key:n,className:t,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0},n)})))},Vf=e=>{let{items:t,toggleItem:n}=e;return t.length?(0,v.createElement)(Ou.Z,{label:(0,N.__)("Tools")},t.map((e=>{let[t,r]=e;const o=r?(0,N.sprintf)((0,N.__)("Hide and reset %s"),t):(0,N.sprintf)((0,N.__)("Show %s"),t);return(0,v.createElement)(Zu.Z,{key:t,icon:r&&If.Z,isSelected:r,label:o,onClick:()=>{r?(0,fl.D)((0,N.sprintf)((0,N.__)("%s hidden and reset to default"),t),"assertive"):(0,fl.D)((0,N.sprintf)((0,N.__)("%s is now visible"),t),"assertive"),n(t)},role:"menuitemcheckbox"},t)}))):null};var Wf=(0,Ku.Iq)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:l,headingLevel:a=2,label:s,menuItems:c,resetAll:u,toggleItem:d,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,qu.y)(e,"ToolsPanelHeader"),o=(0,Yu.I)(),i=(0,v.useMemo)((()=>o(Rf,t)),[t,o]),l=(0,v.useMemo)((()=>o(Ff)),[o]),a=(0,v.useMemo)((()=>o(Mf)),[o]),s=(0,v.useMemo)((()=>o(zf)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=hf();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:s,dropdownMenuClassName:l,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!s)return null;const m=Object.entries((null==c?void 0:c.default)||{}),f=Object.entries((null==c?void 0:c.optional)||{}),h=n?Tf.Z:Nf.Z,g=(0,N.sprintf)((0,N._x)("%s options","Button label to reveal tool panel options"),s),b=n?(0,N.__)("All options are currently hidden"):void 0,y=[...m,...f].some((e=>{let[,t]=e;return t}));return(0,v.createElement)(Bf.Z,(0,Po.Z)({},p,{ref:t}),(0,v.createElement)(Lf.Z,{level:a,className:l},s),i&&(0,v.createElement)(zo.Z,{icon:h,label:g,menuProps:{className:o},toggleProps:{isSmall:!0,describedBy:b}},(()=>(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Hf,{items:m,toggleItem:d,itemClassName:r}),(0,v.createElement)(Vf,{items:f,toggleItem:d}),(0,v.createElement)(Ou.Z,null,(0,v.createElement)(Zu.Z,{"aria-disabled":!y,variant:"tertiary",onClick:()=>{y&&(u(),(0,fl.D)((0,N.__)("All options reset"),"assertive"))}},(0,N.__)("Reset all")))))))}),"ToolsPanelHeader");const $f=e=>{let{panelItems:t,shouldReset:n,currentMenuItems:r}=e;const o={default:{},optional:{}};return t.forEach((e=>{var t;let{hasValue:i,isShownByDefault:l,label:a}=e;const s=l?"default":"optional",c=(null==r||null===(t=r[s])||void 0===t?void 0:t[a])||i();o[s][a]=!n&&c})),o},Uf=e=>e&&0===Object.keys(e).length;const Gf={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var qf=n(26028);var Kf=(0,Ku.Iq)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:l=3,isInline:a=!1,justify:s,rowGap:c,rows:u,templateColumns:d,templateRows:p,...m}=(0,qu.y)(e,"Grid"),f=Array.isArray(i)?i:[i],h=(0,qf.V)(f),g=Array.isArray(u)?u:[u],b=(0,qf.V)(g),y=d||!!i&&`repeat( ${h}, 1fr )`,_=p||!!u&&`repeat( ${b}, 1fr )`,k=(0,Yu.I)();return{...m,className:(0,v.useMemo)((()=>{const e=function(e){return e?Gf[e]:{}}(n),i=(0,Qu.iv)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${td.Z.gridBase} * ${l} )`,gridTemplateColumns:y||void 0,gridTemplateRows:_||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:s,verticalAlign:a?"middle":void 0,...e},"","");return k(i,r)}),[t,n,r,o,k,l,y,_,a,s,c])}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({},n,{ref:t}))}),"Grid"),Yf=(0,Ku.Iq)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:l,headingLevel:a,...s}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:l=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:s,...c}=(0,qu.y)(e,"ToolsPanel"),u=(0,v.useRef)(!1),d=u.current;(0,v.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[p,m]=(0,v.useState)([]),[f,h]=(0,v.useState)([]),g=(0,v.useCallback)((e=>{m((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]}))}),[m]),b=(0,v.useCallback)((e=>{m((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[m]),y=(0,v.useCallback)((e=>{h((t=>[...t,e]))}),[h]),_=(0,v.useCallback)((e=>{h((t=>t.filter((t=>t!==e))))}),[h]),[k,x]=(0,v.useState)({default:{},optional:{}});(0,v.useEffect)((()=>{x((e=>$f({panelItems:p,shouldReset:!1,currentMenuItems:e})))}),[p,x]);const w=(0,v.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";x((n=>({...n,[t]:{...n[t],[e]:!0}})))}),[x]),[C,E]=(0,v.useState)(!1);(0,v.useEffect)((()=>{if(Uf(null==k?void 0:k.default)&&!Uf(null==k?void 0:k.optional)){const e=!Object.entries(k.optional).some((e=>{let[,t]=e;return t}));E(e)}}),[k,E]);const S=(0,Yu.I)(),I=(0,v.useMemo)((()=>{const e=i&&(0,Qu.iv)(">div:not( :first-of-type ){display:grid;",Af.columns(2)," ",Af.spacing," ",Af.item.fullWidth,";}",""),n=Uf(null==k?void 0:k.default)&&C&&Df;return S((0,Qu.iv)(Af.columns(2)," ",Af.spacing," border-top:",td.Z.borderWidth," solid ",ed.D.gray[300],";margin-top:-1px;padding:",(0,Kp.D)(4),";",""),e,n,t)}),[C,t,S,i,k]),T=(0,v.useCallback)((e=>{const t=p.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...k,[n]:{...k[n],[e]:!k[n][e]}};x(r)}),[k,p,x]),N=(0,v.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(f));const e=$f({panelItems:p,shouldReset:!0});x(e)}),[p,f,r,x]),B=e=>{const t=k.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return null==n?void 0:n.label},L=B(p),P=B([...p].reverse());return{...c,headingLevel:n,panelContext:(0,v.useMemo)((()=>({areAllOptionalControlsHidden:C,deregisterPanelItem:b,deregisterResetAllFilter:_,firstDisplayedItem:L,flagItemCustomization:w,hasMenuItems:!!p.length,isResetting:u.current,lastDisplayedItem:P,menuItems:k,panelId:o,registerPanelItem:g,registerResetAllFilter:y,shouldRenderPlaceholderItems:l,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:s})),[C,b,_,L,w,P,k,o,p,y,g,l,a,s]),resetAllItems:N,toggleItem:T,className:I}}(e);return(0,v.createElement)(Kf,(0,Po.Z)({},s,{columns:2,ref:t}),(0,v.createElement)(ff.Provider,{value:o},(0,v.createElement)(Wf,{label:r,resetAll:i,toggleItem:l,headingLevel:a}),n))}),"ToolsPanel");function Xf(e){let{children:t,group:n,label:r}=e;const{updateBlockAttributes:o}=(0,S.Z)(ku),{getBlockAttributes:i,getMultiSelectedBlockClientIds:l,getSelectedBlockClientId:a,hasMultiSelection:s}=(0,E.Z)(ku),c=a(),u=(0,v.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=s()?l():[c];n.forEach((n=>{const{style:r}=i(n);let o={style:r};e.forEach((e=>{o={...o,...e(o)}})),o={...o,style:yp(o.style)},t[n]=o})),o(n,t,!0)}),[i,l,s,c,o]);return(0,v.createElement)(Yf,{className:`${n}-block-support-panel`,label:r,resetAll:u,key:c,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Jf(e){let{Slot:t,...n}=e;const r=(0,v.useContext)(ff);return(0,v.createElement)(t,(0,Po.Z)({},n,{fillProps:r,bubblesVirtually:!0}))}function Qf(e){var t;let{__experimentalGroup:n,group:r="default",label:o,...i}=e;n&&((0,St.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),r=n);const l=null===(t=wf[r])||void 0===t?void 0:t.Slot,a=(0,Sf.Z)(null==l?void 0:l.__unstableName),s=Lu(null==l?void 0:l.__unstableName);return l&&a?Boolean(s&&s.length)?o?(0,v.createElement)(Xf,{group:r,label:o},(0,v.createElement)(Jf,(0,Po.Z)({},i,{Slot:l}))):(0,v.createElement)(l,(0,Po.Z)({},i,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const eh=Cf;eh.Slot=Qf;const th=e=>(0,v.createElement)(Cf,(0,Po.Z)({},e,{group:"advanced"}));th.Slot=e=>(0,v.createElement)(Qf,(0,Po.Z)({},e,{group:"advanced"})),th.slotName="InspectorAdvancedControls";var nh=eh;const rh=/[\s#]/g,oh={type:"string",source:"attribute",attribute:"id",selector:"*"},ih=(0,Ao.o)((e=>t=>{if(he(t.name,"anchor")&&t.isSelected){const n="web"===ci.Z.OS,r=(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,className:"html-anchor-control",label:(0,N.__)("HTML anchor"),help:(0,v.createElement)(v.Fragment,null,(0,N.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,v.createElement)(df.Z,{href:(0,N.__)("https://wordpress.org/support/article/page-jumps/")},(0,N.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,N.__)("Add an anchor"),onChange:e=>{e=e.replace(rh,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(e,t),n&&(0,v.createElement)(nh,{group:"advanced"},r),!n&&"core/heading"===t.name&&(0,v.createElement)(nh,null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Heading settings")},r)))}return(0,v.createElement)(e,t)}),"withInspectorControl");(0,_e.KJ)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.anchor)&&void 0!==t?t:{})||he(e,"anchor")&&(e.attributes={...e.attributes,anchor:oh}),e})),(0,_e.KJ)("editor.BlockEdit","core/editor/anchor/with-inspector-control",ih),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return he(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const lh={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,_e.KJ)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||he(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:lh}),e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return he(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const ah=(0,Ao.o)((e=>t=>he(t.name,"customClassName",!0)&&t.isSelected?(0,v.createElement)(v.Fragment,null,(0,v.createElement)(e,t),(0,v.createElement)(nh,{group:"advanced"},(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,N.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,N.__)("Separate multiple classes with spaces.")}))):(0,v.createElement)(e,t)),"withInspectorControl");(0,_e.KJ)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return he(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,_e.KJ)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",ah),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return he(t,"customClassName",!0)&&n.className&&(e.className=w()(e.className,n.className)),e})),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!he(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){var o;const r=null===(o=t[n])||void 0===o?void 0:o.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return he(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([gn(t.name),...e.className.split(" ")])].join(" ").trim():e.className=gn(t.name)),e}));var sh=n(75667),ch=n(64539),uh=n(74481),dh=n(44890);function ph(e){return(0,Ao.o)((t=>{const n="core/with-filters/"+e;let r;class o extends v.Component{constructor(){super(...arguments),void 0===r&&(r=(0,_e.O)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,_e.KG)("hookRemoved",n,l),(0,_e.KG)("hookAdded",n,l))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,_e.iR)("hookRemoved",n),(0,_e.iR)("hookAdded",n))}render(){return(0,v.createElement)(r,this.props)}}o.instances=[];const i=(0,dh.D)((()=>{r=(0,_e.O)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function l(t){t===e&&i()}return o}),"withFilters")}var mh=n(53874),fh=n(19883),hh=n(27897),gh=n(72608),vh=function(e){return(0,Ao.o)((t=>n=>e(n)?(0,v.createElement)(t,n):null),"ifCondition")},bh=n(92739);const yh=(0,v.createContext)({});function _h(e){let{value:t,children:n}=e;const r=(0,v.useContext)(yh),o=(0,v.useMemo)((()=>({...r,...t})),[r,t]);return(0,v.createElement)(yh.Provider,{value:o,children:n})}var kh=yh;const xh={};var wh=ph("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,r=pe(n),o=(0,v.useContext)(kh),i=(0,v.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((e=>{let[t]=e;return r.usesContext.includes(t)}))):xh),[r,o]);if(!r)return null;const l=r.edit||r.save;if(r.apiVersion>1)return(0,v.createElement)(l,(0,Po.Z)({},e,{context:i}));const a=he(r,"className",!0)?gn(n):null,s=w()(a,t.className,e.className);return(0,v.createElement)(l,(0,Po.Z)({},e,{context:i,className:s}))}));function Ch(e){const{name:t,isSelected:n,clientId:r,attributes:o={},__unstableLayoutClassNames:i}=e,{layout:l=null}=o,a={name:t,isSelected:n,clientId:r,layout:he(t,"__experimentalLayout",!1)?l:null,__unstableLayoutClassNames:i};return(0,v.createElement)(Eu,{value:(0,v.useMemo)((()=>a),Object.values(a))},(0,v.createElement)(wh,e))}var Eh=n(44165),Sh=n(6310),Ih=function(e){let{className:t,actions:n,children:r,secondaryActions:o}=e;return(0,v.createElement)("div",{style:{display:"contents",all:"initial"}},(0,v.createElement)("div",{className:w()(t,"block-editor-warning")},(0,v.createElement)("div",{className:"block-editor-warning__contents"},(0,v.createElement)("p",{className:"block-editor-warning__message"},r),(v.Children.count(n)>0||o)&&(0,v.createElement)("div",{className:"block-editor-warning__actions"},v.Children.count(n)>0&&v.Children.map(n,((e,t)=>(0,v.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),o&&(0,v.createElement)(zo.Z,{className:"block-editor-warning__secondary",icon:Sh.Z,label:(0,N.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,v.createElement)(Ou.Z,null,o.map(((e,t)=>(0,v.createElement)(Zu.Z,{onClick:e.onClick,key:t},e.title))))))))))},Th=n(79646);function Nh(e){let{title:t,rawContent:n,renderedContent:r,action:o,actionText:i,className:l}=e;return(0,v.createElement)("div",{className:l},(0,v.createElement)("div",{className:"block-editor-block-compare__content"},(0,v.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,v.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,v.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,v.createElement)(pn.Z,null,(0,bh.Z)(r)))),(0,v.createElement)("div",{className:"block-editor-block-compare__action"},(0,v.createElement)(Mo.ZP,{variant:"secondary",tabIndex:"0",onClick:o},i)))}var Bh=function(e){let{block:t,onKeep:n,onConvert:r,convertor:o,convertButtonText:i}=e;const l=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>_n(e.name,e.attributes,e.innerBlocks)));return t.join("")}(o(t)),a=(s=t.originalContent,c=l,(0,Th.Kx)(s,c).map(((e,t)=>{const n=w()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,v.createElement)("span",{key:t,className:n},e.value)})));var s,c;return(0,v.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,v.createElement)(Nh,{title:(0,N.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,N.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,v.createElement)(Nh,{title:(0,N.__)("After Conversion"),className:"block-editor-block-compare__converted",action:r,actionText:i,rawContent:a,renderedContent:l}))};const Lh=e=>no({HTML:e.originalContent});var Ph=(0,hh.Z)([(0,mh.Z)(((e,t)=>{let{clientId:n}=t;return{block:e(ku).getBlock(n)}})),(0,fh.Z)(((e,t)=>{let{block:n}=t;const{replaceBlock:r}=e(ku);return{convertToClassic(){r(n.clientId,(e=>ke("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){r(n.clientId,(e=>ke("core/html",{content:e.originalContent}))(n))},convertToBlocks(){r(n.clientId,Lh(n))},attemptBlockRecovery(){r(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:r}=e;return ke(t,n,r)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:r,attemptBlockRecovery:o,block:i}=e;const l=!!pe("core/html"),[a,s]=(0,v.useState)(!1),c=(0,v.useCallback)((()=>s(!0)),[]),u=(0,v.useCallback)((()=>s(!1)),[]),d=(0,v.useMemo)((()=>[{title:(0,N._x)("Resolve","imperative verb"),onClick:c},l&&{title:(0,N.__)("Convert to HTML"),onClick:t},{title:(0,N.__)("Convert to Classic Block"),onClick:r}].filter(Boolean)),[c,t,r]);return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ih,{actions:[(0,v.createElement)(Mo.ZP,{key:"recover",onClick:o,variant:"primary"},(0,N.__)("Attempt Block Recovery"))],secondaryActions:d},(0,N.__)("This block contains unexpected or invalid content.")),a&&(0,v.createElement)(Eh.Z,{title:(0,N.__)("Resolve Block"),onRequestClose:u,className:"block-editor-block-compare"},(0,v.createElement)(Bh,{block:i,onKeep:t,onConvert:n,convertor:Lh,convertButtonText:(0,N.__)("Convert to Blocks")})))}));const Ah=(0,v.createElement)(Ih,{className:"block-editor-block-list__block-crash-warning"},(0,N.__)("This block has encountered an error and cannot be previewed."));var Dh=()=>Ah;class Rh extends v.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var Mh=Rh,Oh=n(90384),Zh=function(e){let{clientId:t}=e;const[n,r]=(0,v.useState)(""),o=(0,E.Z)((e=>e(ku).getBlock(t)),[t]),{updateBlock:i}=(0,S.Z)(ku);return(0,v.useEffect)((()=>{r(xn(o))}),[o]),(0,v.createElement)(Oh.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=pe(o.name);if(!e)return;const l=Cr(e,n,o.attributes),a=n||_n(e,l),[s]=n?lr({...o,attributes:l,originalContent:a}):[!0];i(t,{attributes:l,originalContent:a,isValid:s}),n||r({content:a})},onChange:e=>r(e.target.value)})};function Fh(){let{isDisabled:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,bl.Z)((t=>{var n;if(e)return;const r=null==t||null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;const o=[],i=()=>{t.childNodes.forEach((e=>{e instanceof r.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),o.push((()=>{e.removeAttribute("inert")}))))}))},l=(0,dh.D)(i,0,{leading:!0});i();const a=new window.MutationObserver(l);return a.observe(t,{childList:!0}),()=>{a&&a.disconnect(),l.cancel(),o.forEach((e=>e()))}}),[e])}var jh=ng(),zh=e=>Jh(e,jh),Hh=ng();zh.write=e=>Jh(e,Hh);var Vh=ng();zh.onStart=e=>Jh(e,Vh);var Wh=ng();zh.onFrame=e=>Jh(e,Wh);var $h=ng();zh.onFinish=e=>Jh(e,$h);var Uh=[];zh.setTimeout=(e,t)=>{let n=zh.now()+t,r=()=>{let e=Uh.findIndex((e=>e.cancel==r));~e&&Uh.splice(e,1),Yh-=~e?1:0},o={time:n,handler:e,cancel:r};return Uh.splice(Gh(n),0,o),Yh+=1,Qh(),o};var Gh=e=>~(~Uh.findIndex((t=>t.time>e))||~Uh.length);zh.cancel=e=>{Vh.delete(e),Wh.delete(e),$h.delete(e),jh.delete(e),Hh.delete(e)},zh.sync=e=>{Xh=!0,zh.batchedUpdates(e),Xh=!1},zh.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,zh.onStart(n)}return r.handler=e,r.cancel=()=>{Vh.delete(n),t=null},r};var qh=typeof window<"u"?window.requestAnimationFrame:()=>{};zh.use=e=>qh=e,zh.now=typeof performance<"u"?()=>performance.now():Date.now,zh.batchedUpdates=e=>e(),zh.catch=console.error,zh.frameLoop="always",zh.advance=()=>{"demand"!==zh.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):tg()};var Kh=-1,Yh=0,Xh=!1;function Jh(e,t){Xh?(t.delete(e),e(0)):(t.add(e),Qh())}function Qh(){Kh<0&&(Kh=0,"demand"!==zh.frameLoop&&qh(eg))}function eg(){~Kh&&(qh(eg),zh.batchedUpdates(tg))}function tg(){let e=Kh;Kh=zh.now();let t=Gh(Kh);t&&(rg(Uh.splice(0,t),(e=>e.handler())),Yh-=t),Yh?(Vh.flush(),jh.flush(e?Math.min(64,Kh-e):16.667),Wh.flush(),Hh.flush(),$h.flush()):Kh=-1}function ng(){let e=new Set,t=e;return{add(n){Yh+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Yh-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Yh-=t.size,rg(t,(t=>t(n)&&e.add(t))),Yh+=e.size,t=e)}}}function rg(e,t){e.forEach((e=>{try{t(e)}catch(e){zh.catch(e)}}))}var og=Object.defineProperty,ig={};function lg(){}((e,t)=>{for(var n in t)og(e,n,{get:t[n],enumerable:!0})})(ig,{assign:()=>_g,colors:()=>vg,createStringInterpolator:()=>mg,skipAnimation:()=>bg,to:()=>fg,willAdvance:()=>yg});var ag={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function sg(e,t){if(ag.arr(e)){if(!ag.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function ug(e,t,n){if(ag.arr(e))for(let r=0;rag.und(e)?[]:ag.arr(e)?e:[e];function pg(e,t){if(e.size){let n=Array.from(e);e.clear(),cg(n,t)}}var mg,fg,hg=(e,...t)=>pg(e,(e=>e(...t))),gg=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),vg=null,bg=!1,yg=lg,_g=e=>{e.to&&(fg=e.to),e.now&&(zh.now=e.now),void 0!==e.colors&&(vg=e.colors),null!=e.skipAnimation&&(bg=e.skipAnimation),e.createStringInterpolator&&(mg=e.createStringInterpolator),e.requestAnimationFrame&&zh.use(e.requestAnimationFrame),e.batchedUpdates&&(zh.batchedUpdates=e.batchedUpdates),e.willAdvance&&(yg=e.willAdvance),e.frameLoop&&(zh.frameLoop=e.frameLoop)},kg=new Set,xg=[],wg=[],Cg=0,Eg={get idle(){return!kg.size&&!xg.length},start(e){Cg>e.priority?(kg.add(e),zh.onStart(Sg)):(Ig(e),zh(Ng))},advance:Ng,sort(e){if(Cg)zh.onFrame((()=>Eg.sort(e)));else{let t=xg.indexOf(e);~t&&(xg.splice(t,1),Tg(e))}},clear(){xg=[],kg.clear()}};function Sg(){kg.forEach(Ig),kg.clear(),zh(Ng)}function Ig(e){xg.includes(e)||Tg(e)}function Tg(e){xg.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(xg,(t=>t.priority>e.priority)),0,e)}function Ng(e){let t=wg;for(let n=0;n0}var Bg="[-+]?\\d*\\.?\\d+",Lg=Bg+"%";function Pg(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ag=new RegExp("rgb"+Pg(Bg,Bg,Bg)),Dg=new RegExp("rgba"+Pg(Bg,Bg,Bg,Bg)),Rg=new RegExp("hsl"+Pg(Bg,Lg,Lg)),Mg=new RegExp("hsla"+Pg(Bg,Lg,Lg,Bg)),Og=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Zg=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Fg=/^#([0-9a-fA-F]{6})$/,jg=/^#([0-9a-fA-F]{8})$/;function zg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Hg(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=zg(o,r,e+1/3),l=zg(o,r,e),a=zg(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*l)<<16|Math.round(255*a)<<8}function Vg(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Wg(e){return(parseFloat(e)%360+360)%360/360}function $g(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ug(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Gg(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Fg.exec(e))?parseInt(t[1]+"ff",16)>>>0:vg&&void 0!==vg[e]?vg[e]:(t=Ag.exec(e))?(Vg(t[1])<<24|Vg(t[2])<<16|Vg(t[3])<<8|255)>>>0:(t=Dg.exec(e))?(Vg(t[1])<<24|Vg(t[2])<<16|Vg(t[3])<<8|$g(t[4]))>>>0:(t=Og.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=jg.exec(e))?parseInt(t[1],16)>>>0:(t=Zg.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Rg.exec(e))?(255|Hg(Wg(t[1]),Ug(t[2]),Ug(t[3])))>>>0:(t=Mg.exec(e))?(Hg(Wg(t[1]),Ug(t[2]),Ug(t[3]))|$g(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var qg=(e,t,n)=>{if(ag.fun(e))return e;if(ag.arr(e))return qg({range:e,output:t,extrapolate:n});if(ag.str(e.output[0]))return mg(e);let r=e,o=r.output,i=r.range||[0,1],l=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,l,a,s){let c=s?s(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],s,l,a,r.map)}},Kg=1.70158,Yg=1.525*Kg,Xg=Kg+1,Jg=2*Math.PI/3,Qg=2*Math.PI/4.5,ev=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,tv={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>Xg*e*e*e-Kg*e*e,easeOutBack:e=>1+Xg*Math.pow(e-1,3)+Kg*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(Yg+1)*e-Yg)/2:(Math.pow(2*e-2,2)*((Yg+1)*(2*e-2)+Yg)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*Jg),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*Jg)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*Qg)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*Qg)/2+1,easeInBounce:e=>1-ev(1-e),easeOutBounce:ev,easeInOutBounce:e=>e<.5?(1-ev(1-2*e))/2:(1+ev(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},nv=Symbol.for("FluidValue.get"),rv=Symbol.for("FluidValue.observers"),ov=e=>Boolean(e&&e[nv]),iv=e=>e&&e[nv]?e[nv]():e,lv=e=>e[rv]||null;function av(e,t){let n=e[rv];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var sv=class{[nv];[rv];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");cv(this,e)}},cv=(e,t)=>mv(e,nv,t);function uv(e,t){if(e[nv]){let n=e[rv];n||mv(e,rv,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function dv(e,t){let n=e[rv];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[rv]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var pv,mv=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),fv=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hv=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,gv=new RegExp(`(${fv.source})(%|[a-z]+)`,"i"),vv=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bv=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,yv=e=>{let[t,n]=_v(e);if(!t||gg())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&bv.test(n)?yv(n):n||e},_v=e=>{let t=bv.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},kv=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,xv=e=>{pv||(pv=vg?new RegExp(`(${Object.keys(vg).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>iv(e).replace(bv,yv).replace(hv,Gg).replace(pv,Gg))),n=t.map((e=>e.match(fv).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>qg({...e,output:t})));return e=>{let n=!gv.test(t[0])&&t.find((e=>gv.test(e)))?.replace(fv,""),o=0;return t[0].replace(fv,(()=>`${r[o++](e)}${n||""}`)).replace(vv,kv)}},wv="react-spring: ",Cv=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${wv}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ev=Cv(console.warn),Sv=Cv(console.warn);function Iv(e){return ag.str(e)&&("#"==e[0]||/\d/.test(e)||!gg()&&bv.test(e)||e in(vg||{}))}new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var Tv=gg()?v.useEffect:v.useLayoutEffect;function Nv(){let e=(0,v.useState)()[1],t=(()=>{let e=(0,v.useRef)(!1);return Tv((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}var Bv=e=>(0,v.useEffect)(e,Lv),Lv=[];function Pv(e){let t=(0,v.useRef)();return(0,v.useEffect)((()=>{t.current=e})),t.current}var Av=Symbol.for("Animated:node"),Dv=e=>e&&e[Av],Rv=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,Av,t),Mv=e=>e&&e[Av]&&e[Av].getPayload(),Ov=class{payload;constructor(){Rv(this,this)}getPayload(){return this.payload||[]}},Zv=class extends Ov{constructor(e){super(),this._value=e,ag.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new Zv(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ag.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,ag.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Fv=class extends Zv{_string=null;_toString;constructor(e){super(0),this._toString=qg({output:[e,e]})}static create(e){return new Fv(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(ag.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=qg({output:[this.getValue(),e]})),this._value=0,super.reset()}},jv={dependencies:null},zv=class extends Ov{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return ug(this.source,((n,r)=>{var o;(o=n)&&o[Av]===o?t[r]=n.getValue(e):ov(n)?t[r]=iv(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&cg(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return ug(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){jv.dependencies&&ov(e)&&jv.dependencies.add(e);let t=Mv(e);t&&cg(t,(e=>this.add(e)))}},Hv=class extends zv{constructor(e){super(e)}static create(e){return new Hv(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Vv)),!0)}};function Vv(e){return(Iv(e)?Fv:Zv).create(e)}function Wv(e){let t=Dv(e);return t?t.constructor:ag.arr(e)?Hv:Iv(e)?Fv:Zv}var $v=(e,t)=>{let n=!ag.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,v.forwardRef)(((r,o)=>{let i=(0,v.useRef)(null),l=n&&(0,v.useCallback)((e=>{i.current=function(e,t){return e&&(ag.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,s]=function(e,t){let n=new Set;return jv.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new zv(e),jv.dependencies=null,[e,n]}(r,t),c=Nv(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new Uv(u,s),p=(0,v.useRef)();Tv((()=>(p.current=d,cg(s,(e=>uv(e,d))),()=>{p.current&&(cg(p.current.deps,(e=>dv(e,p.current))),zh.cancel(p.current.update))}))),(0,v.useEffect)(u,[]),Bv((()=>()=>{let e=p.current;cg(e.deps,(t=>dv(t,e)))}));let m=t.getComponentProps(a.getValue());return v.createElement(e,{...m,ref:l})}))},Uv=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&zh.write(this.update)}},Gv=Symbol.for("AnimatedComponent"),qv=e=>ag.str(e)?e:e&&ag.str(e.displayName)?e.displayName:ag.fun(e)&&e.name||null;function Kv(e,...t){return ag.fun(e)?e(...t):e}var Yv=(e,t)=>!0===e||!!(t&&e&&(ag.fun(e)?e(t):dg(e).includes(t))),Xv=(e,t)=>ag.obj(e)?t&&e[t]:e,Jv=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Qv=e=>e,eb=(e,t=Qv)=>{let n=tb;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);ag.und(n)||(r[o]=n)}return r},tb=["config","onProps","onStart","onChange","onPause","onResume","onRest"],nb={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function rb(e){let t=function(e){let t={},n=0;if(ug(e,((e,r)=>{nb[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return ug(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function ob(e){return e=iv(e),ag.arr(e)?e.map(ob):Iv(e)?ig.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function ib(e){for(let t in e)return!0;return!1}function lb(e){return ag.fun(e)||ag.arr(e)&&ag.obj(e[0])}function ab(e,t){e.ref?.delete(e),t?.delete(e)}function sb(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var cb={tension:170,friction:26,mass:1,damping:1,easing:tv.linear,clamp:!1};function ub(e,t){if(ag.und(t.decay)){let n=!ag.und(t.tension)||!ag.und(t.friction);(n||!ag.und(t.frequency)||!ag.und(t.damping)||!ag.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var db=[];function pb(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((l,a)=>{let s,c,u=Yv(n.cancel??r?.cancel,t);if(u)m();else{ag.und(n.pause)||(o.paused=Yv(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||Yv(e,t)),s=Kv(n.delay||0,t),e?(o.resumeQueue.add(p),i.pause()):(i.resume(),p())}function d(){o.resumeQueue.add(p),o.timeouts.delete(c),c.cancel(),s=c.time-zh.now()}function p(){s>0&&!ig.skipAnimation?(o.delayed=!0,c=zh.setTimeout(m,s),o.pauseQueue.add(d),o.timeouts.add(c)):m()}function m(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},l)}catch(e){a(e)}}}))}var mb=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?gb(e.get()):t.every((e=>e.noop))?fb(e.get()):hb(e.get(),t.every((e=>e.finished))),fb=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),hb=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),gb=e=>({value:e,cancelled:!0,finished:!1});function vb(e,t,n,r){let{callId:o,parentId:i,onRest:l}=t,{asyncTo:a,promise:s}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,p=eb(t,((e,t)=>"onRest"===t?void 0:e)),m=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=o<=(n.cancelId||0)&&gb(r)||o!==n.asyncId&&hb(r,!1);if(t)throw e.result=t,u(e),e},h=(e,t)=>{let i=new yb,l=new _b;return(async()=>{if(ig.skipAnimation)throw bb(n),l.result=hb(r,!1),u(l),l;f(i);let a=ag.obj(e)?{...e}:{...t,to:e};a.parentId=o,ug(p,((e,t)=>{ag.und(a[t])&&(a[t]=e)}));let s=await r.start(a);return f(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),s})()};if(ig.skipAnimation)return bb(n),hb(r,!1);try{let t;t=ag.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(c),m]),d=hb(r.get(),!0,!1)}catch(e){if(e instanceof yb)d=e.result;else{if(!(e instanceof _b))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?s:void 0)}return ag.fun(l)&&zh.batchedUpdates((()=>{l(d,r,r.item)})),d})():s}function bb(e,t){pg(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var yb=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},_b=class extends Error{result;constructor(){super("SkipAnimationSignal")}},kb=e=>e instanceof wb,xb=1,wb=class extends sv{id=xb++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Dv(this);return e&&e.getValue()}to(...e){return ig.to(this,e)}interpolate(...e){return Ev(`${wv}The "interpolate" function is deprecated in v9 (use "to" instead)`),ig.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){av(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Eg.sort(this),av(this,{type:"priority",parent:this,priority:e})}},Cb=Symbol.for("SpringPhase"),Eb=e=>(1&e[Cb])>0,Sb=e=>(2&e[Cb])>0,Ib=e=>(4&e[Cb])>0,Tb=(e,t)=>t?e[Cb]|=3:e[Cb]&=-3,Nb=(e,t)=>t?e[Cb]|=4:e[Cb]&=-5,Bb=class extends wb{key;animation=new class{changed=!1;values=db;toValues=null;fromValues=db;to;from;config=new class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,cb)}};immediate=!1};queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!ag.und(e)||!ag.und(t)){let n=ag.obj(e)?{...e}:{...t,from:e};ag.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Sb(this)||this._state.asyncTo)||Ib(this)}get goal(){return iv(this.animation.to)}get velocity(){let e=Dv(this);return e instanceof Zv?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Eb(this)}get isAnimating(){return Sb(this)}get isPaused(){return Ib(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,l=Mv(r.to);!l&&ov(r.to)&&(i=dg(iv(r.to))),r.values.forEach(((a,s)=>{if(a.done)return;let c=a.constructor==Fv?1:l?l[s].lastPosition:i[s],u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,i=r.fromValues[s],l=null!=a.v0?a.v0:a.v0=ag.arr(o.velocity)?o.velocity[s]:o.velocity,p=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(ag.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+l/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<=p,t=l*r}else{t=null==a.lastVelocity?l:a.lastVelocity;let n,r=o.restVelocity||p/10,s=o.clamp?0:o.bounce,m=!ag.und(s),f=i==c?a.v0>0:ir,n||(u=Math.abs(c-d)<=p,!u));++e)m&&(h=d==c||d>c==f,h&&(t=-t*s,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,n=a.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}l&&!l[s].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));let a=Dv(this),s=a.getValue();if(t){let e=iv(r.to);s===e&&!n||o.decay?n&&o.decay&&this._onChange(s):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(s)}set(e){return zh.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Sb(this)){let{to:e,config:t}=this.animation;zh.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return ag.und(e)?(n=this.queue||[],this.queue=[]):n=[ag.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>mb(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),bb(this._state,e&&this._lastCallId),zh.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=ag.obj(n)?n[t]:n,(null==n||lb(n))&&(n=void 0),r=ag.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return Eb(this)||(e.reverse&&([n,r]=[r,n]),r=iv(r),ag.und(r)?Dv(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,eb(e,((e,t)=>/^on/.test(t)?Xv(e,n):e))),Ob(this,e,"onProps"),Zb(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return pb(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{Ib(this)||(Nb(this,!0),hg(i.pauseQueue),Zb(this,"onPause",hb(this,Lb(this,this.animation.to)),this))},resume:()=>{Ib(this)&&(Nb(this,!1),Sb(this)&&this._resume(),hg(i.resumeQueue),Zb(this,"onResume",hb(this,Lb(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=Pb(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(gb(this));let r=!ag.und(e.to),o=!ag.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(gb(this));this._lastToId=t.callId}let{key:i,defaultProps:l,animation:a}=this,{to:s,from:c}=a,{to:u=s,from:d=c}=e;o&&!r&&(!t.default||ag.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let p=!sg(d,c);p&&(a.from=d),d=iv(d);let m=!sg(u,s);m&&this._focus(u);let f=lb(t.to),{config:h}=a,{decay:g,velocity:v}=h;(r||o)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(ub(n={...n},t),t={...n,...t}),ub(e,t),Object.assign(e,t);for(let t in cb)null==e[t]&&(e[t]=cb[t]);let{mass:r,frequency:o,damping:i}=e;ag.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(h,Kv(t.config,i),t.config!==l.config?Kv(l.config,i):void 0);let b=Dv(this);if(!b||ag.und(u))return n(hb(this,!0));let y=ag.und(t.reset)?o&&!t.default:!ag.und(d)&&Yv(t.reset,i),_=y?d:this.get(),k=ob(u),x=ag.num(k)||ag.arr(k)||Iv(k),w=!f&&(!x||Yv(l.immediate||t.immediate,i));if(m){let e=Wv(u);if(e!==b.constructor){if(!w)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(k)}}let C=b.constructor,E=ov(u),S=!1;if(!E){let e=y||!Eb(this)&&p;(m||e)&&(S=sg(ob(_),k),E=!S),(!sg(a.immediate,w)&&!w||!sg(h.decay,g)||!sg(h.velocity,v))&&(E=!0)}if(S&&Sb(this)&&(a.changed&&!y?E=!0:E||this._stop(s)),!f&&((E||ov(s))&&(a.values=b.getPayload(),a.toValues=ov(u)?null:C==Fv?[1]:dg(k)),a.immediate!=w&&(a.immediate=w,!w&&!y&&this._set(s)),E)){let{onRest:e}=a;cg(Mb,(e=>Ob(this,t,e)));let r=hb(this,Lb(this,s));hg(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&zh.batchedUpdates((()=>{a.changed=!y,e?.(r,this),y?Kv(l.onRest,r):a.onStart?.(r,this)}))}y&&this._set(_),f?n(vb(t.to,t,this._state,this)):E?this._start():Sb(this)&&!m?this._pendingCalls.add(n):n(fb(_))}_focus(e){let t=this.animation;e!==t.to&&(lv(this)&&this._detach(),t.to=e,lv(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;ov(t)&&(uv(t,this),kb(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;ov(e)&&dv(e,this)}_set(e,t=!0){let n=iv(e);if(!ag.und(n)){let e=Dv(this);if(!e||!sg(n,e.getValue())){let r=Wv(n);e&&e.constructor==r?e.setValue(n):Rv(this,r.create(n)),e&&zh.batchedUpdates((()=>{this._onChange(n,t)}))}}return Dv(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Zb(this,"onStart",hb(this,Lb(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Kv(this.animation.onChange,e,this)),Kv(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Dv(this).reset(iv(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Sb(this)||(Tb(this,!0),Ib(this)||this._resume())}_resume(){ig.skipAnimation?this.finish():Eg.start(this)}_stop(e,t){if(Sb(this)){Tb(this,!1);let n=this.animation;cg(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),av(this,{type:"idle",parent:this});let r=t?gb(this.get()):hb(this.get(),Lb(this,e??n.to));hg(this._pendingCalls,r),n.changed&&(n.changed=!1,Zb(this,"onRest",r,this))}}};function Lb(e,t){let n=ob(t);return sg(ob(e.get()),n)}function Pb(e,t=e.loop,n=e.to){let r=Kv(t);if(r){let o=!0!==r&&rb(r),i=(o||e).reverse,l=!o||o.reset;return Ab({...e,loop:t,default:!1,pause:void 0,to:!i||lb(n)?n:void 0,from:l?e.from:void 0,reset:l,...o})}}function Ab(e){let{to:t,from:n}=e=rb(e),r=new Set;return ag.obj(t)&&Rb(t,r),ag.obj(n)&&Rb(n,r),e.keys=r.size?Array.from(r):null,e}function Db(e){let t=Ab(e);return ag.und(t.default)&&(t.default=eb(t)),t}function Rb(e,t){ug(e,((e,n)=>null!=e&&t.add(n)))}var Mb=["onStart","onRest","onChange","onPause","onResume"];function Ob(e,t,n){e.animation[n]=t[n]!==Jv(t,n)?Xv(t[n],e.key):void 0}function Zb(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Fb=["onStart","onChange","onRest"],jb=1,zb=class{id=jb++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];ag.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ab(e)),this}start(e){let{queue:t}=this;return e?t=dg(e).map(Ab):this.queue=[],this._flush?this._flush(this,t):(qb(this,t),Hb(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;cg(dg(t),(t=>n[t].stop(!!e)))}else bb(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(ag.und(e))this.start({pause:!0});else{let t=this.springs;cg(dg(e),(e=>t[e].pause()))}return this}resume(e){if(ag.und(e))this.start({pause:!1});else{let t=this.springs;cg(dg(e),(e=>t[e].resume()))}return this}each(e){ug(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,pg(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,l=o||i&&n.size?this.get():null;o&&t.size&&pg(t,(([e,t])=>{t.value=l,e(t,this,this._item)})),i&&(this._started=!1,pg(n,(([e,t])=>{t.value=l,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}zh.onFrame(this._onFrame)}};function Hb(e,t){return Promise.all(t.map((t=>Vb(e,t)))).then((t=>mb(e,t)))}async function Vb(e,t,n){let{keys:r,to:o,from:i,loop:l,onRest:a,onResolve:s}=t,c=ag.obj(t.default)&&t.default;l&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=ag.arr(o)||ag.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):cg(Fb,(n=>{let r=t[n];if(ag.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,hg(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let p=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Jv(t,"cancel");(u||m&&d.asyncId)&&p.push(pb(++e._lastAsyncId,{props:t,state:d,actions:{pause:lg,resume:lg,start(t,n){m?(bb(d,e._lastAsyncId),n(gb(e))):(t.onRest=a,n(vb(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=mb(e,await Promise.all(p));if(l&&f.finished&&(!n||!f.noop)){let n=Pb(t,l,o);if(n)return qb(e,[n]),Vb(e,n,!0)}return s&&zh.batchedUpdates((()=>s(f,e,e.item))),f}function Wb(e,t){let n={...e.springs};return t&&cg(dg(t),(e=>{ag.und(e.keys)&&(e=Ab(e)),ag.obj(e.to)||(e={...e,to:void 0}),Gb(n,e,(e=>Ub(e)))})),$b(e,n),n}function $b(e,t){ug(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,uv(t,e))}))}function Ub(e,t){let n=new Bb;return n.key=e,t&&uv(n,t),n}function Gb(e,t,n){t.keys&&cg(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}function qb(e,t){cg(t,(t=>{Gb(e.springs,t,(t=>Ub(t,e)))}))}var Kb,Yb,Xb=({children:e,...t})=>{let n=(0,v.useContext)(Jb),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,v.useState)((()=>({inputs:t,result:e()}))),r=(0,v.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=Jb;return v.createElement(i,{value:t},e)},Jb=(Kb=Xb,Yb={},Object.assign(Kb,v.createContext(Yb)),Kb.Provider._context=Kb,Kb.Consumer._context=Kb,Kb);Xb.Provider=Jb.Provider,Xb.Consumer=Jb.Consumer;var Qb=()=>{let e=[],t=function(t){Sv(`${wv}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);let r=[];return cg(e,((e,o)=>{if(ag.und(t))r.push(e.start());else{let i=n(t,e,o);i&&r.push(e.start(i))}})),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return cg(e,(e=>e.pause(...arguments))),this},t.resume=function(){return cg(e,(e=>e.resume(...arguments))),this},t.set=function(t){cg(e,((e,n)=>{let r=ag.fun(t)?t(n,e):t;r&&e.set(r)}))},t.start=function(t){let n=[];return cg(e,((e,r)=>{if(ag.und(t))n.push(e.start());else{let o=this._getProps(t,e,r);o&&n.push(e.start(o))}})),n},t.stop=function(){return cg(e,(e=>e.stop(...arguments))),this},t.update=function(t){return cg(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};let n=function(e,t,n){return ag.fun(e)?e(n,t):e};return t._getProps=n,t};function ey(e,t,n){let r=ag.fun(t)&&t;r&&!n&&(n=[]);let o=(0,v.useMemo)((()=>r||3==arguments.length?Qb():void 0),[]),i=(0,v.useRef)(0),l=Nv(),a=(0,v.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let n=Wb(e,t);return i.current>0&&!a.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Hb(e,t):new Promise((r=>{$b(e,n),a.queue.push((()=>{r(Hb(e,t))})),l()}))}})),[]),s=(0,v.useRef)([...a.ctrls]),c=[],u=Pv(e)||0;function d(e,n){for(let o=e;o{cg(s.current.slice(e,u),(e=>{ab(e,o),e.stop(!0)})),s.current.length=e,d(u,e)}),[e]),(0,v.useMemo)((()=>{d(0,Math.min(u,e))}),n);let p=s.current.map(((e,t)=>Wb(e,c[t]))),m=(0,v.useContext)(Xb),f=Pv(m),h=m!==f&&ib(m);Tv((()=>{i.current++,a.ctrls=s.current;let{queue:e}=a;e.length&&(a.queue=[],cg(e,(e=>e()))),cg(s.current,((e,t)=>{o?.add(e),h&&e.start({default:m});let n=c[t];n&&(sb(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Bv((()=>()=>{cg(a.ctrls,(e=>e.stop(!0)))}));let g=p.map((e=>({...e})));return o?[g,o]:g}var ty=class extends wb{constructor(e,t){super(),this.source=e,this.calc=qg(...t);let n=this._get(),r=Wv(n);Rv(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();sg(t,this.get())||(Dv(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&ry(this._active)&&oy(this)}_get(){let e=ag.arr(this.source)?this.source.map(iv):dg(iv(this.source));return this.calc(...e)}_start(){this.idle&&!ry(this._active)&&(this.idle=!1,cg(Mv(this),(e=>{e.done=!1})),ig.skipAnimation?(zh.batchedUpdates((()=>this.advance())),oy(this)):Eg.start(this))}_attach(){let e=1;cg(dg(this.source),(t=>{ov(t)&&uv(t,this),kb(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){cg(dg(this.source),(e=>{ov(e)&&dv(e,this)})),this._active.clear(),oy(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=dg(this.source).reduce(((e,t)=>Math.max(e,(kb(t)?t.priority:0)+1)),0))}};function ny(e){return!1!==e.idle}function ry(e){return!e.size||Array.from(e).every(ny)}function oy(e){e.idle||(e.idle=!0,cg(Mv(e),(e=>{e.done=!0})),av(e,{type:"idle",parent:e}))}ig.assign({createStringInterpolator:xv,to:(e,t)=>new ty(e,t)}),Eg.advance;var iy=/^--/;function ly(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||iy.test(e)||sy.hasOwnProperty(e)&&sy[e]?(""+t).trim():t+"px"}var ay={},sy={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cy=["Webkit","Ms","Moz","O"];sy=Object.keys(sy).reduce(((e,t)=>(cy.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),sy);var uy=/^(matrix|translate|scale|rotate|skew)/,dy=/^(translate)/,py=/^(rotate|skew)/,my=(e,t)=>ag.num(e)&&0!==e?e+t:e,fy=(e,t)=>ag.arr(e)?e.every((e=>fy(e,t))):ag.num(e)?e===t:parseFloat(e)===t,hy=class extends zv{constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>my(e,"px"))).join(",")})`,fy(e,0)]))),ug(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(uy.test(t)){if(delete r[t],ag.und(e))return;let n=dy.test(t)?"px":py.test(t)?"deg":"";o.push(dg(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${my(o,n)})`,fy(o,0)]:e=>[`${t}(${e.map((e=>my(e,n))).join(",")})`,fy(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new gy(o,i)),super(r)}},gy=class extends sv{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return cg(this.inputs,((n,r)=>{let o=iv(n[0]),[i,l]=this.transforms[r](ag.arr(o)?o:n.map(iv));e+=" "+i,t=t&&l})),t?"none":e}observerAdded(e){1==e&&cg(this.inputs,(e=>cg(e,(e=>ov(e)&&uv(e,this)))))}observerRemoved(e){0==e&&cg(this.inputs,(e=>cg(e,(e=>ov(e)&&dv(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),av(this,e)}};ig.assign({batchedUpdates:b.unstable_batchedUpdates,createStringInterpolator:xv,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var vy=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new zv(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=qv(e)||"Anonymous";return(e=ag.str(e)?i[e]||(i[e]=$v(e,o)):e[Gv]||(e[Gv]=$v(e,o))).displayName=`Animated(${t})`,e};return ug(e,((t,n)=>{ag.arr(e)&&(n=qv(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:l,viewBox:a,...s}=t,c=Object.values(s),u=Object.keys(s).map((t=>n||e.hasAttribute(t)?t:ay[t]||(ay[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=ly(t,r[t]);iy.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==l&&(e.scrollLeft=l),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new hy(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),by=(vy.animated,n(2734)),yy=n(16573);const _y=e=>e+1,ky=e=>({top:e.offsetTop,left:e.offsetLeft});var xy=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:r,triggerAnimationOnChange:o}=e;const i=(0,v.useRef)(),l=(0,by.Z)()||!r,[a,s]=(0,v.useReducer)(_y,0),[c,u]=(0,v.useReducer)(_y,0),[d,p]=(0,v.useState)({x:0,y:0}),m=(0,v.useMemo)((()=>i.current?ky(i.current):null),[o]),f=(0,v.useMemo)((()=>{if(!n||!i.current)return()=>{};const e=(0,yy.Z)(i.current);if(!e)return()=>{};const t=i.current.getBoundingClientRect();return()=>{const n=i.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[o,n]);return(0,v.useLayoutEffect)((()=>{a&&u()}),[a]),(0,v.useLayoutEffect)((()=>{if(!m)return;if(l)return void f();i.current.style.transform=void 0;const e=ky(i.current);s(),p({x:Math.round(m.left-e.left),y:Math.round(m.top-e.top)})}),[o]),function(e,t){let n=ag.fun(e),[[r],o]=ey(1,n?e:[e],n?t||[]:t)}({from:{x:d.x,y:d.y},to:{x:0,y:0},reset:a!==c,config:{mass:5,tension:2e3,friction:200},immediate:l,onChange:function(e){let{value:n}=e;if(!i.current)return;let{x:r,y:o}=n;r=Math.round(r),o=Math.round(o);const l=0===r&&0===o;i.current.style.transformOrigin="center center",i.current.style.transform=l?void 0:`translate3d(${r}px,${o}px,0)`,i.current.style.zIndex=t?"1":"",f()}}),i},wy=n(56247),Cy=n(25542),Ey=n(25936),Sy=n(96293);const Iy=".block-editor-block-list__block",Ty=".block-list-appender",Ny=".block-editor-button-block-appender";function By(e,t){return t.closest([Iy,Ty,Ny].join(","))===e}function Ly(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Iy);return t?t.id.slice("block-".length):void 0}function Py(e){const t=(0,v.useRef)(),n=function(e){return(0,E.Z)((t=>{const{getSelectedBlocksInitialCaretPosition:n,__unstableGetEditorMode:r,isBlockSelected:o}=t(ku);if(o(e)&&"edit"===r())return n()}),[e])}(e),{isBlockSelected:r,isMultiSelecting:o}=(0,E.Z)(ku);return(0,v.useEffect)((()=>{if(!r(e)||o())return;if(null==n)return;if(!t.current)return;const{ownerDocument:i}=t.current;if(By(t.current,i.activeElement))return;const l=wy.focus.tabbable.find(t.current).filter((e=>(0,Cy.Z)(e))),a=-1===n,s=l[a?l.length-1:0]||t.current;if(By(t.current,s)){if(!t.current.getAttribute("contenteditable")){const e=wy.focus.tabbable.findNext(t.current);if(e&&By(t.current,e)&&(0,Ey.Z)(e))return void e.focus()}(0,Sy.Z)(s,a)}else t.current.focus()}),[n,e]),t}function Ay(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Dy(){const e=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return t().outlineMode}),[]);return(0,bl.Z)((t=>{if(e)return t.addEventListener("mouseout",Ay),t.addEventListener("mouseover",Ay),()=>{t.removeEventListener("mouseout",Ay),t.removeEventListener("mouseover",Ay),t.classList.remove("is-hovered")}}),[e])}function Ry(e){return(0,E.Z)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:r,isBlockSelected:o,isBlockMultiSelected:i,getBlockName:l,getSettings:a,hasSelectedInnerBlock:s,isTyping:c,__unstableIsFullySelected:u,__unstableSelectionHasUnmergeableBlock:d}=t(ku),{outlineMode:p}=a(),m=n(e),f=o(e),h=l(e),g=s(e,!0),v=i(e);return w()({"is-selected":f,"is-highlighted":r(e),"is-multi-selected":v,"is-partially-selected":v&&!u()&&!d(),"is-reusable":ge(pe(h)),"is-dragging":m,"has-child-selected":g,"remove-outline":f&&p&&c()})}),[e])}function My(e){return(0,E.Z)((t=>{const n=t(ku).getBlockName(e),r=pe(n);if((null==r?void 0:r.apiVersion)>1)return gn(n)}),[e])}function Oy(e){return(0,E.Z)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(ku),o=r(e);if(null==o||!o.className)return;const i=pe(n(e));return(null==i?void 0:i.apiVersion)>1?o.className:void 0}),[e])}function Zy(e){return(0,E.Z)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:r,getBlockName:o,getBlockRootClientId:i,isBlockSelected:l}=t(ku);if(!l(e))return;const a=n();return a?w()("is-block-moving-mode",{"can-insert-moving-block":r(o(a),i(e))}):void 0}),[e])}function Fy(e){const{isBlockSelected:t}=(0,E.Z)(ku),{selectBlock:n,selectionChange:r}=(0,S.Z)(ku);return(0,bl.Z)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):By(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}function jy(e){const t=(0,E.Z)((t=>t(ku).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:r}=(0,E.Z)(ku),{insertDefaultBlock:o,removeBlock:i}=(0,S.Z)(ku);return(0,bl.Z)((l=>{if(t)return l.addEventListener("keydown",a),l.addEventListener("dragstart",s),()=>{l.removeEventListener("keydown",a),l.removeEventListener("dragstart",s)};function a(t){const{keyCode:a,target:s}=t;a!==Al.ENTER&&a!==Al.BACKSPACE&&a!==Al.DELETE||s!==l||(0,Cy.Z)(s)||(t.preventDefault(),a===Al.ENTER?o({},n(e),r(e)+1):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function zy(e){const{isNavigationMode:t,isBlockSelected:n}=(0,E.Z)(ku),{setNavigationMode:r,selectBlock:o}=(0,S.Z)(ku);return(0,bl.Z)((i=>{function l(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",l),()=>{i.addEventListener("mousedown",l)}}),[e,t,n,r])}const Hy=(0,v.createContext)({refs:new Map,callbacks:new Map});function Vy(e){let{children:t}=e;const n=(0,v.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,v.createElement)(Hy.Provider,{value:n},t)}function Wy(e){const{refs:t,callbacks:n}=(0,v.useContext)(Hy),r=(0,v.useRef)();return(0,v.useLayoutEffect)((()=>(t.set(r,e),()=>{t.delete(r)})),[e]),(0,bl.Z)((t=>{r.current=t,n.forEach(((n,r)=>{e===n&&r(t)}))}),[e])}function $y(e){const{refs:t}=(0,v.useContext)(Hy),n=(0,v.useRef)();return n.current=e,(0,v.useMemo)((()=>({get current(){let e=null;for(const[r,o]of t.entries())o===n.current&&r.current&&(e=r.current);return e}})),[])}function Uy(e){const{callbacks:t}=(0,v.useContext)(Hy),n=$y(e),[r,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)((()=>{if(e)return t.set(o,e),()=>{t.delete(o)}}),[e]),n.current||r}function Gy(){const e=(0,v.useContext)(zI);return(0,bl.Z)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function qy(e){return(0,E.Z)((t=>{const{__unstableHasActiveBlockOverlayActive:n}=t(ku);return n(e)}),[e])}function Ky(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:r,wrapperProps:o={},isAligned:i}=(0,v.useContext)(Yy),{index:l,mode:a,name:s,blockApiVersion:c,blockTitle:u,isPartOfSelection:d,adjustScrolling:p,enableAnimation:m}=(0,E.Z)((e=>{const{getBlockAttributes:t,getBlockIndex:r,getBlockMode:o,getBlockName:i,isTyping:l,getGlobalBlockCount:a,isBlockSelected:s,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(ku),{getActiveBlockVariation:p}=e(Xt),m=s(n),f=c(n)||u(n),h=i(n),g=pe(h),v=p(h,t(n));return{index:r(n),mode:o(n),name:h,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:(null==v?void 0:v.title)||(null==g?void 0:g.title),isPartOfSelection:m||f,adjustScrolling:m||d(n),enableAnimation:!l()&&a()<=200}}),[n]),f=qy(n),h=(0,N.sprintf)((0,N.__)("Block: %s"),u),g="html"!==a||t?"":"-visual",b=(0,vl.Z)([e.ref,Py(n),Wy(n),Fy(n),jy(n),zy(n),Dy(),Gy(),xy({isSelected:d,adjustScrolling:p,enableAnimation:m,triggerAnimationOnChange:l}),Fh({isDisabled:!f})]),y=Su();return c<2&&n===y.clientId&&"undefined"!=typeof process&&process.env,{tabIndex:0,...o,...e,ref:b,id:`block-${n}${g}`,role:"document","aria-label":h,"data-block":n,"data-type":s,"data-title":u,className:w()(w()("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":f}),r,e.className,o.className,Ry(n),My(n),Oy(n),Zy(n)),style:{...o.style,...e.style}}}Ky.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:n}=bn;return(0,_e.O)("blocks.getSaveContent.extraProps",{...e},t,n)};const Yy=(0,v.createContext)();function Xy(e){let{children:t,isHtml:n,...r}=e;return(0,v.createElement)("div",Ky(r,{__unstableIsHtml:n}),t)}const Jy=(0,mh.Z)(((e,t)=>{let{clientId:n,rootClientId:r}=t;const{isBlockSelected:o,getBlockMode:i,isSelectionEnabled:l,getTemplateLock:a,__unstableGetBlockWithoutInnerBlocks:s,canRemoveBlock:c,canMoveBlock:u}=e(ku),d=s(n),p=o(n),m=a(r),f=c(n,r),h=u(n,r),{name:g,attributes:v,isValid:b}=d||{};return{mode:i(n),isSelectionEnabled:l(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Qy=(0,fh.Z)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:l,toggleSelection:a,__unstableMarkLastChangeAsPersistent:s,moveBlocksToPosition:c,removeBlock:u}=e(ku);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(ku),i=o(),{clientId:l}=t,a=i.length?i:[l];r(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:l}=n.select(ku),a=l(r);o(e,a+1,i)},onMerge(e){const{clientId:r,rootClientId:l}=t,{getPreviousBlockClientId:a,getNextBlockClientId:s,getBlock:d,getBlockAttributes:p,getBlockName:m,getBlockOrder:f,getBlockIndex:h,getBlockRootClientId:g,canInsertBlockType:v}=n.select(ku);function b(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=g(e),i=f(e),[l]=i;if(1===i.length&&Re(d(l)))u(e);else{if(v(m(l),r))c([l],e,r,h(e));else{const i=Pe(d(l),de());i&&i.length&&n.batch((()=>{o(i,h(e),r,t),u(l,!1)}))}!f(e).length&&Re(d(e))&&u(e,!1)}}if(e){if(l){const e=s(l);if(e){if(m(l)!==m(e))return void i(l,e);{const t=p(l),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(f(e),e,l),u(e,!1)}))}}}const e=s(r);if(!e)return;f(e).length?b(e,!1):i(r,e)}else{const e=a(r);if(e)i(e,r);else if(l){const e=a(l);if(e&&m(l)===m(e)){const t=p(l),r=p(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(f(l),l,e),u(l,!1)}))}b(l)}}},onReplace(e,n,r){e.length&&!Me(e[e.length-1])&&s(),l([t.clientId],e,n,r)},toggleSelection(e){a(e)}}}));var e_=(0,hh.Z)(gh.Z,Jy,Qy,vh((e=>{let{block:t}=e;return!!t})),ph("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:r,isLocked:o,canRemove:i,clientId:l,isSelected:a,isSelectionEnabled:s,className:c,__unstableLayoutClassNames:u,name:d,isValid:p,attributes:m,wrapperProps:f,setAttributes:h,onReplace:g,onInsertBlocksAfter:b,onMerge:y,toggleSelection:_}=e;const{themeSupportsLayout:k,hasContentLockedParent:x,isContentBlock:C,isContentLocking:I,isTemporarilyEditingAsBlocks:T}=(0,E.Z)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n,getTemplateLock:r,__unstableGetTemporarilyEditingAsBlocks:o}=e(ku),i=!!n(l);return{themeSupportsLayout:t().supportsLayout,isContentBlock:e(Xt).__experimentalHasContentRoleAttribute(d),hasContentLockedParent:i,isContentLocking:"contentOnly"===r(l)&&!i,isTemporarilyEditingAsBlocks:o()===l}}),[d,l]),{removeBlock:N}=(0,S.Z)(ku),B=(0,v.useCallback)((()=>N(l)),[l]),L=Wm()||{};let P=(0,v.createElement)(Ch,{name:d,isSelected:a,attributes:m,setAttributes:h,insertBlocksAfter:o?void 0:b,onReplace:i?g:void 0,onRemove:i?B:void 0,mergeBlocks:i?y:void 0,clientId:l,isSelectionEnabled:s,toggleSelection:_,__unstableLayoutClassNames:u,__unstableParentLayout:Object.keys(L).length?L:void 0});const A=pe(d);x&&!C&&(f={...f,tabIndex:-1}),null!=A&&A.getEditWrapperProps&&(f=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=w()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(f,A.getEditWrapperProps(m)));const D=f&&!!f["data-align"]&&!k;let R;if(D&&(P=(0,v.createElement)("div",{className:"wp-block","data-align":f["data-align"]},P)),p)R="html"===r?(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{style:{display:"none"}},P),(0,v.createElement)(Xy,{isHtml:!0},(0,v.createElement)(Zh,{clientId:l}))):(null==A?void 0:A.apiVersion)>1?P:(0,v.createElement)(Xy,f,P);else{const e=n?hn(n):_n(A,m);R=(0,v.createElement)(Xy,{className:"has-warning"},(0,v.createElement)(Ph,{clientId:l}),(0,v.createElement)(pn.Z,null,(0,bh.Z)(e)))}const{"data-align":M,...O}=null!==(t=f)&&void 0!==t?t:{},Z={clientId:l,className:w()({"is-content-locked":I,"is-content-locked-temporarily-editing-as-blocks":T,"is-content-block":x&&C},M&&k&&`align${M}`,c),wrapperProps:O,isAligned:D},F=(0,v.useMemo)((()=>Z),Object.values(Z));return(0,v.createElement)(Yy.Provider,{value:F},(0,v.createElement)(Mh,{fallback:(0,v.createElement)(Xy,{className:"has-warning"},(0,v.createElement)(Dh,null))},R))})),t_=n(17416),n_=n(87734),r_=n(17647);let o_,i_,l_,a_;const s_=/<(\/)?(\w+)\s*(\/)?>/g;function c_(e,t,n,r,o){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:o,children:[]}}function u_(e){const t=function(){const e=s_.exec(o_);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,o,i]=e,l=n.length;return i?["self-closed",o,t,l]:r?["closer",o,t,l]:["opener",o,t,l]}(),[n,r,o,i]=t,l=a_.length,a=o>i_?i_:null;if(!e[r])return d_(),!1;switch(n){case"no-more-tokens":if(0!==l){const{leadingTextStart:e,tokenStart:t}=a_.pop();l_.push(o_.substr(e,t))}return d_(),!1;case"self-closed":return 0===l?(null!==a&&l_.push(o_.substr(a,o-a)),l_.push(e[r]),i_=o+i,!0):(p_(c_(e[r],o,i)),i_=o+i,!0);case"opener":return a_.push(c_(e[r],o,i,o+i,a)),i_=o+i,!0;case"closer":if(1===l)return function(e){const{element:t,leadingTextStart:n,prevOffset:r,tokenStart:o,children:i}=a_.pop(),l=e?o_.substr(r,e-r):o_.substr(r);l&&i.push(l),null!==n&&l_.push(o_.substr(n,o-n)),l_.push((0,v.cloneElement)(t,null,...i))}(o),i_=o+i,!0;const t=a_.pop(),n=o_.substr(t.prevOffset,o-t.prevOffset);t.children.push(n),t.prevOffset=o+i;const s=c_(t.element,t.tokenStart,t.tokenLength,o+i);return s.children=t.children,p_(s),i_=o+i,!0;default:return d_(),!1}}function d_(){const e=o_.length-i_;0!==e&&l_.push(o_.substr(i_,e))}function p_(e){const{element:t,tokenStart:n,tokenLength:r,prevOffset:o,children:i}=e,l=a_[a_.length-1],a=o_.substr(l.prevOffset,n-l.prevOffset);a&&l.children.push(a),l.children.push((0,v.cloneElement)(t,null,...i)),l.prevOffset=o||n+r}var m_=(e,t)=>{if(o_=e,i_=0,l_=[],a_=[],s_.lastIndex=0,!(e=>{const t="object"==typeof e,n=t&&Object.values(e);return t&&n.length&&n.every((e=>(0,v.isValidElement)(e)))})(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are WPElements");do{}while(u_(t));return(0,v.createElement)(v.Fragment,null,...l_)},f_=n(28943),h_=function(e){const{children:t}=e;return(0,v.createElement)("div",{className:"components-tip"},(0,v.createElement)(om.Z,{icon:f_.Z}),(0,v.createElement)("p",null,t))};const g_=[m_((0,N.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,v.createElement)("kbd",null)}),m_((0,N.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,v.createElement)("kbd",null)}),m_((0,N.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,v.createElement)("kbd",null)}),(0,N.__)("Drag files into the editor to automatically insert media blocks."),(0,N.__)("Change a block's type by pressing the block icon on the toolbar.")];var v_=function(){const[e]=(0,v.useState)(Math.floor(Math.random()*g_.length));return(0,v.createElement)(h_,null,g_[e])},b_=n(83158),y_=n(74193),__=n(50418),k_=(0,v.memo)((function(e){var t;let{icon:n,showColors:r=!1,className:o,context:i}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:__.Z});const l=(0,v.createElement)(Od.Z,{icon:n&&n.src?n.src:n,context:i}),a=r?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,v.createElement)("span",{style:a,className:w()("block-editor-block-icon",o,{"has-colors":r})},l)})),x_=function(e){let{title:t,icon:n,description:r,blockType:o,className:i}=e;o&&((0,St.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:r}=o));const{parentNavBlockClientId:l}=(0,E.Z)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(ku);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:a}=(0,S.Z)(ku);return(0,v.createElement)("div",{className:w()("block-editor-block-card",i)},l&&(0,v.createElement)(Mo.ZP,{onClick:()=>a(l),label:(0,N.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,N.isRTL)()?b_.Z:y_.Z,isSmall:!0}),(0,v.createElement)(k_,{icon:n,showColors:!0}),(0,v.createElement)("div",{className:"block-editor-block-card__content"},(0,v.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,v.createElement)("span",{className:"block-editor-block-card__description"},r)))},w_=n(30285),C_=n(3563),E_=n(7673);const S_=(0,Ao.o)((e=>(0,w_.Z)((t=>{let{useSubRegistry:n=!0,registry:r,...o}=t;if(!n)return(0,v.createElement)(e,(0,Po.Z)({registry:r},o));const[i,l]=(0,v.useState)(null);return(0,v.useEffect)((()=>{const e=(0,C_.p)({},r);e.registerStore(vu,_u),l(e)}),[r]),i?(0,v.createElement)(E_.ZP,{value:i},(0,v.createElement)(e,(0,Po.Z)({registry:i},o))):null}))),"withRegistryProvider"),I_=()=>{};function T_(e){let{clientId:t=null,value:n,selection:r,onChange:o=I_,onInput:i=I_}=e;const l=(0,yl.Z)(),{resetBlocks:a,resetSelection:s,replaceInnerBlocks:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=l.dispatch(ku),{getBlockName:p,getBlocks:m}=l.select(ku),f=(0,E.Z)((e=>!t||e(ku).areInnerBlocksControlled(t)),[t]),h=(0,v.useRef)({incoming:null,outgoing:[]}),g=(0,v.useRef)(!1),b=()=>{n&&(d(),t?l.batch((()=>{u(t,!0);const e=n.map((e=>Ce(e)));g.current&&(h.current.incoming=e),d(),c(t,e)})):(g.current&&(h.current.incoming=n),a(n)))},y=(0,v.useRef)(i),_=(0,v.useRef)(o);(0,v.useEffect)((()=>{y.current=i,_.current=o}),[i,o]),(0,v.useEffect)((()=>{h.current.outgoing.includes(n)?h.current.outgoing[h.current.outgoing.length-1]===n&&(h.current.outgoing=[]):m(t)!==n&&(h.current.outgoing=[],b(),r&&s(r.selectionStart,r.selectionEnd,r.initialPosition))}),[n,t]),(0,v.useEffect)((()=>{f||(h.current.outgoing=[],b())}),[f]),(0,v.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:r,isLastBlockChangePersistent:o,__unstableIsLastBlockChangeIgnored:i,areInnerBlocksControlled:a}=l.select(ku);let s=m(t),c=o(),u=!1;g.current=!0;const d=l.subscribe((()=>{if(null!==t&&null===p(t))return;if(t&&!a(t))return;const l=o(),d=m(t),f=d!==s;if(s=d,f&&(h.current.incoming||i()))return h.current.incoming=null,void(c=l);(f||u&&!f&&l&&!c)&&(c=l,h.current.outgoing.push(s),(c?_.current:y.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:r()}})),u=f}));return()=>{g.current=!1,d()}}),[l,t])}const N_=S_((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=yu((0,S.Z)(ku));return(0,v.useEffect)((()=>{o({...n,__internalIsInitialized:!0},r)}),[n]),T_(e),(0,v.createElement)(Vy,null,t)}));var B_=e=>(0,v.createElement)(N_,(0,Po.Z)({},e,{stripExperimentalSettings:!0}),e.children);const L_={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},P_=(0,v.createContext)(!1),{Consumer:A_,Provider:D_}=P_;function R_(e){let{className:t,children:n,isDisabled:r=!0,...o}=e;const i=(0,Yu.I)();return(0,v.createElement)(D_,{value:r},(0,v.createElement)("div",(0,Po.Z)({inert:r?"true":void 0,className:r?i(L_,t,"components-disabled"):void 0},o),n))}R_.Context=P_,R_.Consumer=A_;var M_=R_;function O_(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,E.Z)(ku),{clearSelectedBlock:r}=(0,S.Z)(ku),{clearBlockSelection:o}=e();return(0,bl.Z)((e=>{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function Z_(e){return(0,v.createElement)("div",(0,Po.Z)({ref:O_()},e))}function F_(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:l}=e(ku);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:l()}}function j_(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,E.Z)(F_,[]);return(0,bl.Z)((o=>{const{ownerDocument:l}=o,{defaultView:a}=l;if(null==e)return;if(!r||t)return;const{length:s}=n;s<2||i&&(o.contentEditable=!0,o.focus(),a.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}var z_=n(12999),H_=n(15309),V_=n(137),W_=n(6188),$_=n(71265);function U_(e,t,n,r){let o,i=wy.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(1!==e.children.length||!function(e,t){return e.closest(Iy)===t.closest(Iy)}(e,e.firstElementChild)||"true"!==e.firstElementChild.getAttribute("contenteditable")){if(!wy.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function G_(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,E.Z)(ku),{selectBlock:i}=(0,S.Z)(ku);return(0,bl.Z)((l=>{let a;function s(){a=null}function c(s){if(s.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:p,altKey:m,metaKey:f}=s,h=c===Al.UP,g=c===Al.DOWN,v=c===Al.LEFT,b=c===Al.RIGHT,y=h||v,_=v||b,k=h||g,x=_||k,w=d||p||m||f,C=k?z_.Z:H_.Z,{ownerDocument:E}=l,{defaultView:S}=E;if(!x)return;if(r()){if(d)return;if(!o())return;return s.preventDefault(),void(y?i(e()):i(t(),-1))}if(!function(e,t,n){if((t===Al.UP||t===Al.DOWN)&&!n)return!0;const{tagName:r}=e;return"INPUT"===r?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==r}(u,c,w))return;k?a||(a=(0,V_.Z)(S)):a=null;const I=(0,W_.Z)(u)?!y:y,{keepCaretInsideBlock:T}=n();if(d)(function(e,t){const n=U_(e,t,l);return n&&Ly(n)})(u,y)&&C(u,y)&&(l.contentEditable=!0,l.focus());else if(!k||!(0,z_.Z)(u,y)||m&&!(0,H_.Z)(u,I)||T){if(_&&S.getSelection().isCollapsed&&(0,H_.Z)(u,I)&&!T){const e=U_(u,I,l);(0,Sy.Z)(e,y),s.preventDefault()}}else{const e=U_(u,y,l,!0);e&&((0,$_.Z)(e,m?!y:y,m?void 0:a),s.preventDefault())}}return l.addEventListener("mousedown",s),l.addEventListener("keydown",c),()=>{l.removeEventListener("mousedown",s),l.removeEventListener("keydown",c)}}),[])}var q_=n(82009),K_=n(18883);function Y_(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,E.Z)(ku),{multiSelect:r,selectBlock:o}=(0,S.Z)(ku),i=(0,K_.sx)();return(0,bl.Z)((l=>{function a(a){if(!i("core/block-editor/select-all",a))return;const s=t();if(s.length<2&&!(0,q_.Z)(a.target))return;a.preventDefault();const[c]=s,u=n(c),d=e(u);s.length!==d.length?r(d[0],d[d.length-1]):u&&(l.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return l.addEventListener("keydown",a),()=>{l.removeEventListener("keydown",a)}}),[])}function X_(e,t){e.contentEditable=t,t&&e.focus()}function J_(){const{startMultiSelect:e,stopMultiSelect:t}=(0,S.Z)(ku),{isSelectionEnabled:n,hasMultiSelection:r,isDraggingBlocks:o}=(0,E.Z)(ku);return(0,bl.Z)((i=>{const{ownerDocument:l}=i,{defaultView:a}=l;let s,c;function u(){t(),a.removeEventListener("mouseup",u),c=a.requestAnimationFrame((()=>{if(r())return;X_(i,!1);const e=a.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function d(t){let{buttons:r,target:c}=t;o()||1===r&&c.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),a.addEventListener("mouseup",u),X_(i,!0))}return i.addEventListener("mouseout",d),()=>{i.removeEventListener("mouseout",d),a.removeEventListener("mouseup",u),a.cancelAnimationFrame(c)}}),[e,t,n,r])}function Q_(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t),t&&e.focus()}function ek(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,S.Z)(ku),{getBlockParents:r,getBlockSelectionStart:o}=(0,E.Z)(ku);return(0,bl.Z)((n=>{const{ownerDocument:i}=n,{defaultView:l}=i;function a(i){const a=l.getSelection();if(!a.rangeCount)return;const s=i.shiftKey&&"mouseup"===i.type;if(a.isCollapsed&&!s)return void Q_(n,!1);let c=Ly(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(a)),u=Ly(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(a));if(s){const e=o(),t=Ly(i.target),n=t!==u;(c===u&&a.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...r(c),c],n=[...r(u),u],o=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[o],n[o])}else Q_(n,!1)}function s(){i.addEventListener("selectionchange",a),l.addEventListener("mouseup",a)}function c(){i.removeEventListener("selectionchange",a),l.removeEventListener("mouseup",a)}function u(){c(),s()}return s(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,r])}function tk(){const{selectBlock:e}=(0,S.Z)(ku),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,E.Z)(ku);return(0,bl.Z)((o=>{function i(i){if(!t()||0!==i.button)return;const l=n(),a=Ly(i.target);i.shiftKey?l!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function nk(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:r}=(0,E.Z)(ku),{replaceBlocks:o,__unstableSplitSelection:i,removeBlocks:l,__unstableDeleteSelection:a,__unstableExpandSelection:s}=(0,S.Z)(ku);return(0,bl.Z)((c=>{function u(e){var t;r()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function d(u){u.defaultPrevented||r()&&(u.keyCode===Al.ENTER?(c.contentEditable=!1,u.preventDefault(),e()?o(t(),ke(de())):i()):u.keyCode===Al.BACKSPACE||u.keyCode===Al.DELETE?(c.contentEditable=!1,u.preventDefault(),e()?l(t()):n()?a(u.keyCode===Al.DELETE):s()):1!==u.key.length||u.metaKey||u.ctrlKey||(c.contentEditable=!1,n()?a(u.keyCode===Al.DELETE):(u.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){r()&&(c.contentEditable=!1,n()?a():(e.preventDefault(),c.ownerDocument.defaultView.getSelection().removeAllRanges()))}return c.addEventListener("beforeinput",u),c.addEventListener("keydown",d),c.addEventListener("compositionstart",p),()=>{c.removeEventListener("beforeinput",u),c.removeEventListener("keydown",d),c.removeEventListener("compositionstart",p)}}),[])}function rk(){const[e,t,n]=function(){const e=(0,v.useRef)(),t=(0,v.useRef)(),n=(0,v.useRef)(),r=(0,v.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:i,getBlockCount:l}=(0,E.Z)(ku),{setNavigationMode:a}=(0,S.Z)(ku),s=(0,E.Z)((e=>e(ku).isNavigationMode()),[])?void 0:"0",c=(0,v.useRef)();function u(t){if(c.current)c.current=null;else if(o())e.current.focus();else if(i())r.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";wy.focus.tabbable[n](t.target).focus()}}const d=(0,v.createElement)("div",{ref:t,tabIndex:s,onFocus:u}),p=(0,v.createElement)("div",{ref:n,tabIndex:s,onFocus:u}),m=(0,bl.Z)((s=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===Al.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==Al.TAB)return;const r=e.shiftKey,l=r?"findPrevious":"findNext";if(!o()&&!i())return void(e.target===s&&a(!0));if(((0,Ey.Z)(e.target)||e.target.getAttribute("data-block")===i())&&(0,Ey.Z)(wy.focus.tabbable[l](e.target)))return;const u=r?t:n;c.current=!0,u.current.focus({preventScroll:!0})}function d(e){r.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==l()||s.focus()}function p(r){var o;if(r.keyCode!==Al.TAB)return;if("region"===(null===(o=r.target)||void 0===o?void 0:o.getAttribute("role")))return;if(e.current===r.target)return;const i=r.shiftKey?"findPrevious":"findNext",l=wy.focus.tabbable[i](r.target);l!==t.current&&l!==n.current||(r.preventDefault(),l.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",u),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",u),s.removeEventListener("focusout",d)}}),[]);return[d,(0,vl.Z)([e,m]),p]}(),r=(0,E.Z)((e=>e(ku).hasMultiSelection()),[]);return[e,(0,vl.Z)([t,nk(),J_(),ek(),tk(),j_(),Y_(),G_(),(0,bl.Z)((e=>{if(e.tabIndex=0,e.contentEditable=r,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,N.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}var ok=(0,v.forwardRef)((function(e,t){let{children:n,...r}=e;const[o,i,l]=rk();return(0,v.createElement)(v.Fragment,null,o,(0,v.createElement)("div",(0,Po.Z)({},r,{ref:(0,vl.Z)([i,t]),className:w()(r.className,"block-editor-writing-flow")}),n),l)}));function ik(e){return(0,v.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}function lk(e){var t,n,r,o;let{contentRef:i,children:l,head:a,tabIndex:s=0,scale:c=1,frameSize:u=0,expand:d=!1,readonly:p,forwardedRef:m,...f}=e;const h=(0,E.Z)((e=>e(ku).getSettings().__unstableResolvedAssets),[]),[,g]=(0,v.useReducer)((()=>({}))),[y,_]=(0,v.useState)(),[k,x]=(0,v.useState)([]),C=ik(null==h?void 0:h.styles),S=C.map((e=>e.id)),I=(0,v.useMemo)((()=>Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("LINK"!==n.tagName)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:r,cssRules:o}=t;return r?e(o):n&&(n.includes(".editor-styles-wrapper")||n.includes(".wp-block"))}))}(r)){e.push(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}return e}),[])),[]),T=I.filter((e=>!S.includes(e.id))),B=ik(null==h?void 0:h.scripts),L=O_(),[P,A,D]=rk(),[R,{height:M}]=ud(),O=(0,bl.Z)((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{readyState:i,documentElement:l}=r;return t=r,("interactive"===i||"complete"===i)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function r(e){const r=Object.getPrototypeOf(e).constructor.name,o=window[r],i={};for(const t in e)i[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();i.clientX+=e.left,i.clientY+=e.top}const l=new o(e.type,i);!n.dispatchEvent(l)&&e.preventDefault()}const o=["dragover"];for(const t of o)e.addEventListener(t,r)}(r),_(r),L(l),x(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir,l.removeChild(r.head),l.removeChild(r.body),t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1),!0)}return e.addEventListener("load",r),()=>{var o,i;e.removeEventListener("load",r),null===(o=t)||void 0===o||o.removeEventListener("dragover",n),null===(i=t)||void 0===i||i.removeEventListener("drop",n)}}),[]),Z=(0,bl.Z)((e=>{B.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:r}=t;return new Promise(((t,o)=>{const i=e.ownerDocument.createElement("script");i.id=n,r?(i.src=r,i.onload=()=>t(),i.onerror=()=>o()):t(),e.appendChild(i)}))}(e,n)))),Promise.resolve()).finally((()=>{g()}))}),[]),F=Fh({isDisabled:!p}),j=(0,vl.Z)([i,L,A,F]),z=(0,v.createElement)(v.Fragment,null,(0,v.createElement)("style",null,"html{height:auto!important;}body{margin:0}"),[...C,...T].map((e=>{let{tagName:t,href:n,id:r,rel:o,media:i,textContent:l}=e;const a=t.toLowerCase();return"style"===a?(0,v.createElement)(a,{id:r,key:r},l):(0,v.createElement)(a,{href:n,id:r,rel:o,media:i,key:r})}))),H=(0,v.useMemo)((()=>""+(0,mn.ZP)(z)),[]),V=M*(1-c)/2;return(0,v.createElement)(v.Fragment,null,s>=0&&P,(0,v.createElement)("iframe",(0,Po.Z)({},f,{style:{...f.style,height:d?M:null===(t=f.style)||void 0===t?void 0:t.height,marginTop:c?-V+u:null===(n=f.style)||void 0===n?void 0:n.marginTop,marginBottom:c?-V+u:null===(r=f.style)||void 0===r?void 0:r.marginBottom,transform:c?`scale( ${c} )`:null===(o=f.style)||void 0===o?void 0:o.transform,transition:"all .3s"},ref:(0,vl.Z)([m,O]),tabIndex:s,srcDoc:H,title:(0,N.__)("Editor canvas")}),y&&(0,b.createPortal)((0,v.createElement)(v.Fragment,null,(0,v.createElement)("head",{ref:Z},z,a),(0,v.createElement)("body",{ref:j,className:w()("block-editor-iframe__body","editor-styles-wrapper",...k)},R,(0,v.createElement)(Do.Z,{document:y},l))),y.documentElement)),s>=0&&D)}var ak=(0,v.forwardRef)((function(e,t){return(0,E.Z)((e=>e(ku).getSettings().__internalIsInitialized),[])?(0,v.createElement)(lk,(0,Po.Z)({},e,{forwardedRef:t})):null})),sk=n(28771),ck=n.n(sk);const uk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function dk(e,t){t=t||{};let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){const e={line:n,column:r};return function(t){return t.position=new l(e),m(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;const a=[];function s(o){const i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;a.push(i)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=C()||E());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=i();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return s("End of comment missing");const l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}function g(){const e=p(/^([^{]+)/);if(e)return pk(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=i();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=pk(t[0]),!p(/^:\s*/))return s("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:t.replace(uk,""),value:n?pk(n[0]).replace(uk,""):""});return p(/^[;\s]*/),r}function b(){const e=[];if(!c())return s("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(e));return u()?e:s("missing '}'")}function y(){let e;const t=[],n=i();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=w("import"),k=w("charset"),x=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=i(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function C(){if("@"===e[0])return function(){const e=i();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return s("@keyframes missing name");const r=t[1];if(!c())return s("@keyframes missing '{'");let o,l=f();for(;o=y();)l.push(o),l=l.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:l}):s("@keyframes missing '}'")}()||function(){const e=i(),t=p(/^@media *([^{]+)/);if(!t)return;const n=pk(t[1]);if(!c())return s("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):s("@media missing '}'")}()||function(){const e=i(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:pk(t[1]),media:pk(t[2])})}()||function(){const e=i(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=pk(t[1]);if(!c())return s("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):s("@supports missing '}'")}()||_()||k()||x()||function(){const e=i(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=pk(t[1]),r=pk(t[2]);if(!c())return s("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):s("@document missing '}'")}()||function(){const e=i();if(!p(/^@page */))return;const t=g()||[];if(!c())return s("@page missing '{'");let n,r=f();for(;n=v();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):s("@page missing '}'")}()||function(){const e=i();if(!p(/^@host\s*/))return;if(!c())return s("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):s("@host missing '}'")}()||function(){const e=i();if(!p(/^@font-face\s*/))return;if(!c())return s("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):s("@font-face missing '}'")}()}function E(){const e=i(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):s("selector missing")}return mk(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function pk(e){return e?e.replace(/^\s+|\s+$/g,""):""}function mk(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){mk(e,r)})):n&&"object"==typeof n&&mk(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var fk=n(89118),hk=n.n(fk),gk=vk;function vk(e){this.options=e||{}}vk.prototype.emit=function(e){return e},vk.prototype.visit=function(e){return this[e.type](e)},vk.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let r=0,o=e.length;rt=>{if("declaration"===t.type){const i=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const r=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};wk(e)&&r.push(e)}return r}(t.value).map((o=e,e=>({...e,newUrl:"url("+e.before+e.quote+Ck(e.value,o)+e.quote+e.after+")"})));return{...t,value:(n=t.value,r=i,r.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,r,o;return t};const Sk=/^(body|html|:root).*$/;var Ik=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(Sk)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Tk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.values(null!=e?e:[]).map((e=>{let{css:n,baseURL:r}=e;const o=[];return t&&o.push(Ik(t)),r&&o.push(Ek(r)),o.length?xk(n,(0,hh.Z)(o)):n}))};const Nk=".editor-styles-wrapper";function Bk(e){return(0,v.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:r}=t,o=t.querySelector(Nk);let i;if(o)i=n.getComputedStyle(o,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),r.appendChild(e),i=n.getComputedStyle(e,null).getPropertyValue("background-color"),r.removeChild(e)}const l=(0,G.Vi)(i);l.luminance()>.5||0===l.alpha()?r.classList.remove("is-dark-theme"):r.classList.add("is-dark-theme")}),[e])}function Lk(e){let{styles:t}=e;const n=(0,v.useMemo)((()=>Tk(t,Nk)),[t]);return(0,v.createElement)(v.Fragment,null,(0,v.createElement)("style",{ref:Bk(t)}),n.map(((e,t)=>(0,v.createElement)("style",{key:t},e))))}function Pk(e){let{selector:t,id:n}=e;const r=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,v.createElement)("style",null,r)}function Ak(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,v.createElement)("style",null,n)}function Dk(e){let{id:t,colors:n}=e;const r=function(){const e={r:[],g:[],b:[],a:[]};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const n=(0,G.Vi)(t).toRgb();e.r.push(n.r/255),e.g.push(n.g/255),e.b.push(n.b/255),e.a.push(n.a)})),e}(n);return(0,v.createElement)(tp.Wj,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,v.createElement)("defs",null,(0,v.createElement)("filter",{id:t},(0,v.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,v.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,v.createElement)("feFuncR",{type:"table",tableValues:r.r.join(" ")}),(0,v.createElement)("feFuncG",{type:"table",tableValues:r.g.join(" ")}),(0,v.createElement)("feFuncB",{type:"table",tableValues:r.b.join(" ")}),(0,v.createElement)("feFuncA",{type:"table",tableValues:r.a.join(" ")})),(0,v.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function Rk(e){let{preset:t}=e;return(0,v.createElement)(Dk,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Mk;(0,G.l7)([q.Z,K.Z]);const Ok=2e3;function Zk(e){let{viewportWidth:t,containerWidth:n,minHeight:r,additionalStyles:o=[]}=e;t||(t=n);const[i,{height:l}]=ud(),{styles:a,duotone:s}=(0,E.Z)((e=>{var t,n;const r=e(ku).getSettings();return{styles:r.styles,duotone:null===(t=r.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),c=(0,v.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...o]:a),[a,o]),u=(0,v.useMemo)((()=>{var e,t;return[...null!==(e=null==s?void 0:s.default)&&void 0!==e?e:[],...null!==(t=null==s?void 0:s.theme)&&void 0!==t?t:[]]}),[s]);Mk=Mk||(0,gh.Z)(WI);const d=n/t;return(0,v.createElement)(M_,{className:"block-editor-block-preview__content",style:{transform:`scale(${d})`,height:l*d,maxHeight:l>Ok?Ok*d:void 0,minHeight:r}},(0,v.createElement)(ak,{head:(0,v.createElement)(Lk,{styles:c}),contentRef:(0,bl.Z)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:l,pointerEvents:"none",maxHeight:Ok,minHeight:0!==d&&d<1&&r?r/d:r}},i,u.map((e=>(0,v.createElement)(Rk,{preset:e,key:e.slug}))),(0,v.createElement)(Mk,{renderAppender:!1})))}function Fk(e){const[t,{width:n}]=ud();return(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{style:{position:"relative",width:"100%",height:0}},t),(0,v.createElement)("div",{className:"block-editor-block-preview__container"},!!n&&(0,v.createElement)(Zk,(0,Po.Z)({},e,{containerWidth:n}))))}var jk=(0,v.memo)((function(e){let{blocks:t,viewportWidth:n=1200,minHeight:r,additionalStyles:o=[],__experimentalMinHeight:i,__experimentalPadding:l}=e;i&&(r=i,(0,St.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),l&&(o=[...o,{css:`body { padding: ${l}px; }`}],(0,St.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const a=(0,E.Z)((e=>e(ku).getSettings()),[]),s=(0,v.useMemo)((()=>({...a,__unstableIsPreviewMode:!0})),[a]),c=(0,v.useMemo)((()=>Array.isArray(t)?t:[t]),[t]);return t&&0!==t.length?(0,v.createElement)(N_,{value:c,settings:s},(0,v.createElement)(Fk,{viewportWidth:n,minHeight:r,additionalStyles:o})):null})),zk=function(e){var t;let{item:n}=e;const{name:r,title:o,icon:i,description:l,initialAttributes:a,example:s}=n,c=ge(n);return(0,v.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,v.createElement)("div",{className:"block-editor-inserter__preview"},c||s?(0,v.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,v.createElement)(jk,{blocks:s?Ae(r,{attributes:{...s.attributes,...a},innerBlocks:s.innerBlocks}):ke(r,a),viewportWidth:null!==(t=null==s?void 0:s.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 16px; }"}]})):(0,v.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,N.__)("No Preview Available."))),!c&&(0,v.createElement)(x_,{title:o,icon:i,description:l}))},Hk=n(4572);function Vk(e,t){const n=[];for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:{step:1};const{step:n=1}=t,[r,o]=(0,v.useState)([]);return(0,v.useEffect)((()=>{let t=Vk(e,r);t.length{(0,b.flushSync)((()=>{o((t=>[...t,...e.slice(r,r+n)]))}))}));return()=>i.reset()}),[e]),r},$k=n(46388),Uk=(0,Ku.Iq)((function(e,t){const n=(0,$k.Z)(e);return(0,v.createElement)(md.Z,(0,Po.Z)({as:"span"},n,{ref:t}))}),"Truncate"),Gk=n(51454),qk=n(80110),Kk=(0,v.createContext)(),Yk=(0,v.forwardRef)((function(e,t){let{isFirst:n,as:r,children:o,...i}=e;const l=(0,v.useContext)(Kk);return(0,v.createElement)(qk.A,(0,Po.Z)({ref:t,state:l,role:"option",focusable:!0},i),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return r?(0,v.createElement)(r,t,o):"function"==typeof o?o(t):(0,v.createElement)(Mo.ZP,t,o)}))}));const Xk=(e,t,n)=>{let r=!0,o=!0;return n&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),(0,dh.D)(e,t,{leading:r,trailing:o,maxWait:t})},Jk="is-dragging-components-draggable";var Qk=function(e){let{children:t,onDragStart:n,onDragOver:r,onDragEnd:o,cloneClassname:i,elementId:l,transferData:a,__experimentalTransferDataType:s="text",__experimentalDragComponent:c}=e;const u=(0,v.useRef)(null),d=(0,v.useRef)((()=>{}));return(0,v.useEffect)((()=>()=>{d.current()}),[]),(0,v.createElement)(v.Fragment,null,t({onDraggableStart:function(e){const{ownerDocument:t}=e.target;e.dataTransfer.setData(s,JSON.stringify(a));const o=t.createElement("div");o.style.top="0",o.style.left="0";const c=t.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(c.classList.add("components-draggable__invisible-drag-image"),t.body.appendChild(c),e.dataTransfer.setDragImage(c,0,0)),o.classList.add("components-draggable__clone"),i&&o.classList.add(i);let p=0,m=0;if(u.current){p=e.clientX,m=e.clientY,o.style.transform=`translate( ${p}px, ${m}px )`;const n=t.createElement("div");n.innerHTML=u.current.innerHTML,o.appendChild(n),t.body.appendChild(o)}else{const e=t.getElementById(l),n=e.getBoundingClientRect(),r=e.parentNode,i=n.top,a=n.left;o.style.width=`${n.width+0}px`;const s=e.cloneNode(!0);s.id=`clone-${l}`,p=a-0,m=i-0,o.style.transform=`translate( ${p}px, ${m}px )`,Array.from(s.querySelectorAll("iframe")).forEach((e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)})),o.appendChild(s),null==r||r.appendChild(o)}let f=e.clientX,h=e.clientY;const g=Xk((function(e){if(f===e.clientX&&h===e.clientY)return;const t=p+e.clientX-f,n=m+e.clientY-h;o.style.transform=`translate( ${t}px, ${n}px )`,f=e.clientX,h=e.clientY,p=t,m=n,r&&r(e)}),16);let v;t.addEventListener("dragover",g),t.body.classList.add(Jk),e.persist(),n&&(v=setTimeout((()=>n(e)))),d.current=()=>{o&&o.parentNode&&o.parentNode.removeChild(o),c&&c.parentNode&&c.parentNode.removeChild(c),t.body.classList.remove(Jk),t.removeEventListener("dragover",g),clearTimeout(v)}},onDraggableEnd:function(e){e.preventDefault(),d.current(),o&&o(e)}}),c&&(0,v.createElement)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u},c))},ex=n(16459);function tx(e){let{count:t,icon:n,isPattern:r}=e;const o=r&&(0,N.__)("Pattern");return(0,v.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,v.createElement)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip"},(0,v.createElement)(Uu.Z,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,v.createElement)(Gu.Z,null,n?(0,v.createElement)(k_,{icon:n}):o||(0,N.sprintf)((0,N._n)("%d block","%d blocks",t),t)),(0,v.createElement)(Gu.Z,null,(0,v.createElement)(k_,{icon:ex.Z})))))}var nx=e=>{let{isEnabled:t,blocks:n,icon:r,children:o,isPattern:i}=e;const l={type:"inserter",blocks:n};return(0,v.createElement)(Qk,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,v.createElement)(tx,{count:n.length,icon:r,isPattern:i})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return o({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?r:void 0})}))},rx=(0,v.memo)((function(e){let{className:t,isFirst:n,item:r,onSelect:o,onHover:i,isDraggable:l,...a}=e;const s=(0,v.useRef)(!1),c=r.icon?{backgroundColor:r.icon.background,color:r.icon.foreground}:{},u=(0,v.useMemo)((()=>[ke(r.name,r.initialAttributes,xe(r.innerBlocks))]),[r.name,r.initialAttributes,r.initialAttributes]),d=ge(r)||ve(r);return(0,v.createElement)(nx,{isEnabled:l&&!r.disabled,blocks:u,icon:r.icon},(e=>{let{draggable:l,onDragStart:u,onDragEnd:p}=e;return(0,v.createElement)("div",{className:w()("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:l,onDragStart:e=>{s.current=!0,u&&(i(null),u(e))},onDragEnd:e=>{s.current=!1,p&&p(e)}},(0,v.createElement)(Yk,(0,Po.Z)({isFirst:n,className:w()("block-editor-block-types-list__item",t),disabled:r.isDisabled,onClick:e=>{e.preventDefault(),o(r,(0,Gk.R)()?e.metaKey:e.ctrlKey),i(null)},onKeyDown:e=>{const{keyCode:t}=e;t===Al.ENTER&&(e.preventDefault(),o(r,(0,Gk.R)()?e.metaKey:e.ctrlKey),i(null))},onMouseEnter:()=>{s.current||i(r)},onMouseLeave:()=>i(null)},a),(0,v.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:c},(0,v.createElement)(k_,{icon:r.icon,showColors:!0})),(0,v.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,v.createElement)(Uk,{numberOfLines:3},r.title))))}))})),ox=(0,v.forwardRef)((function(e,t){const[n,r]=(0,v.useState)(!1);return(0,v.useEffect)((()=>{n&&(0,fl.D)((0,N.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,v.createElement)("div",(0,Po.Z)({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&r(!1)}},e))})),ix=n(11215),lx=(0,v.forwardRef)((function(e,t){const n=(0,v.useContext)(Kk);return(0,v.createElement)(ix.E,(0,Po.Z)({state:n,role:"presentation",ref:t},e))})),ax=function(e){let{items:t=[],onSelect:n,onHover:r=(()=>{}),children:o,label:i,isDraggable:l=!0}=e;return(0,v.createElement)(ox,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,r=e.length;t(0,v.createElement)(lx,{key:t},e.map(((e,o)=>(0,v.createElement)(rx,{key:e.id,item:e,className:vn(e.id),onSelect:n,onHover:r,isDraggable:l&&!e.isDisabled,isFirst:0===t&&0===o})))))),o)},sx=function(e){let{title:t,icon:n,children:r}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,v.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,v.createElement)(Od.Z,{icon:n})),(0,v.createElement)("div",{className:"block-editor-inserter__panel-content"},r))},cx=(e,t)=>{const{categories:n,collections:r,items:o}=(0,E.Z)((t=>{const{getInserterItems:n}=t(ku),{getCategories:r,getCollections:o}=t(Xt);return{categories:r(),collections:o(),items:n(e)}}),[e]),i=(0,v.useCallback)(((e,n)=>{let{name:r,initialAttributes:o,innerBlocks:i}=e;const l=ke(r,o,xe(i));t(l,void 0,n)}),[t]);return[o,n,r,i]},ux=n(33306),dx=function(e){let{children:t}=e;const n=(0,ux.u)({shift:!0,wrap:"horizontal"});return(0,v.createElement)(Kk.Provider,{value:n},t)};const px=[];var mx=function(e){let{rootClientId:t,onInsert:n,onHover:r,showMostUsedBlocks:o}=e;const[i,l,a,s]=cx(t,n),c=(0,v.useMemo)((()=>Wl(i,"frecency","desc").slice(0,6)),[i]),u=(0,v.useMemo)((()=>i.filter((e=>!e.category))),[i]),d=(0,v.useMemo)((()=>(0,et.Z)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,U.groupBy)(e,"category")))(i)),[i]),p=(0,v.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=i.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[i,a]);(0,v.useEffect)((()=>()=>r(null)),[]);const m=Wk(l),f=l.length===m.length,h=(0,v.useMemo)((()=>Object.entries(a)),[a]),g=Wk(f?h:px);return(0,v.createElement)(dx,null,(0,v.createElement)("div",null,o&&!!c.length&&(0,v.createElement)(sx,{title:(0,N._x)("Most used","blocks")},(0,v.createElement)(ax,{items:c,onSelect:s,onHover:r,label:(0,N._x)("Most used","blocks")})),m.map((e=>{const t=d[e.slug];return t&&t.length?(0,v.createElement)(sx,{key:e.slug,title:e.title,icon:e.icon},(0,v.createElement)(ax,{items:t,onSelect:s,onHover:r,label:e.title})):null})),f&&u.length>0&&(0,v.createElement)(sx,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,N.__)("Uncategorized")},(0,v.createElement)(ax,{items:u,onSelect:s,onHover:r,label:(0,N.__)("Uncategorized")})),g.map((e=>{let[t,n]=e;const o=p[t];return o&&o.length?(0,v.createElement)(sx,{key:t,title:n.title,icon:n.icon},(0,v.createElement)(ax,{items:o,onSelect:s,onHover:r,label:n.title})):null}))))};const fx=(0,Qu.iv)("appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;&:hover{color:",ed.D.ui.theme,";}&:focus{background-color:transparent;color:",ed.D.ui.theme,";border-color:",ed.D.ui.theme,";outline:3px solid transparent;}",""),hx={name:"1bcj5ek",styles:"width:100%;display:block"},gx={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},vx=(0,Qu.iv)("border:1px solid ",td.Z.surfaceBorderColor,";",""),bx=(0,Qu.iv)(">*:not( marquee )>*{border-bottom:1px solid ",td.Z.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),yx=td.Z.controlBorderRadius,_x=(0,Qu.iv)("border-radius:",yx,";",""),kx=(0,Qu.iv)("border-radius:",yx,";>*:first-of-type>*{border-top-left-radius:",yx,";border-top-right-radius:",yx,";}>*:last-of-type>*{border-bottom-left-radius:",yx,";border-bottom-right-radius:",yx,";}",""),xx=`calc(${td.Z.fontSize} * ${td.Z.fontLineHeightBase})`,wx=`calc((${td.Z.controlHeight} - ${xx} - 2px) / 2)`,Cx=`calc((${td.Z.controlHeightSmall} - ${xx} - 2px) / 2)`,Ex=`calc((${td.Z.controlHeightLarge} - ${xx} - 2px) / 2)`,Sx={small:(0,Qu.iv)("padding:",Cx," ",td.Z.controlPaddingXSmall,";",""),medium:(0,Qu.iv)("padding:",wx," ",td.Z.controlPaddingX,";",""),large:(0,Qu.iv)("padding:",Ex," ",td.Z.controlPaddingXLarge,";","")},Ix=(0,v.createContext)({size:"medium"}),Tx=()=>(0,v.useContext)(Ix);var Nx=(0,Ku.Iq)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...l}=(0,qu.y)(e,"ItemGroup");return{isBordered:n,className:(0,Yu.I)()(n&&vx,o&&bx,r&&kx,t),role:i,isSeparated:o,...l}}(e),{size:l}=Tx(),a={spacedAround:!n&&!r,size:o||l};return(0,v.createElement)(Ix.Provider,{value:a},(0,v.createElement)(md.Z,(0,Po.Z)({},i,{ref:t})))}),"ItemGroup"),Bx=(0,Ku.Iq)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...l}=(0,qu.y)(e,"Item"),{spacedAround:a,size:s}=Tx(),c=i||s,u=t||(void 0!==r?"button":"div"),d=(0,Yu.I)(),p=(0,v.useMemo)((()=>d("button"===u&&fx,Sx[c]||Sx.medium,gx,a&&_x,n)),[u,n,d,c,a]),m=d(hx);return{as:u,className:p,onClick:r,wrapperClassName:m,role:o,...l}}(e);return(0,v.createElement)("div",{role:n,className:r},(0,v.createElement)(md.Z,(0,Po.Z)({},o,{ref:t})))}),"Item"),Lx=n(49105),Px=n(46824),Ax=(e,t)=>{const{patternCategories:n,patterns:r}=(0,E.Z)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(ku);return{patterns:n(t),patternCategories:r().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:o}=(0,S.Z)(Px.h),i=(0,v.useCallback)(((t,n)=>{e((null!=n?n:[]).map((e=>Ce(e))),t.name),o((0,N.sprintf)((0,N.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[]);return[r,n,i]},Dx=n(1583);const Rx=e=>{let{showTooltip:t,title:n,children:r}=e;return t?(0,v.createElement)(Ld.Z,{text:n},r):(0,v.createElement)(v.Fragment,null,r)};function Mx(e){let{isDraggable:t,pattern:n,onClick:r,onHover:o,composite:i,showTooltip:l}=e;const[a,s]=(0,v.useState)(!1),{blocks:c,viewportWidth:u}=n,d=`block-editor-block-patterns-list__item-description-${(0,dd.Z)(Mx)}`;return(0,v.createElement)(nx,{isEnabled:t,blocks:c,isPattern:!!n},(e=>{let{draggable:t,onDragStart:p,onDragEnd:m}=e;return(0,v.createElement)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{s(!0),p&&(null==o||o(null),p(e))},onDragEnd:e=>{s(!1),m&&m(e)}},(0,v.createElement)(Rx,{showTooltip:l,title:n.title},(0,v.createElement)(qk.A,(0,Po.Z)({role:"option",as:"div"},i,{className:"block-editor-block-patterns-list__item",onClick:()=>{r(n,c),null==o||o(null)},onMouseEnter:()=>{a||null==o||o(n)},onMouseLeave:()=>null==o?void 0:o(null),"aria-label":n.title,"aria-describedby":n.description?d:void 0}),(0,v.createElement)(jk,{blocks:c,viewportWidth:u}),!l&&(0,v.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,v.createElement)(n_.Z,{id:d},n.description))))}))}function Ox(){return(0,v.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Zx=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:r,onHover:o,onClickPattern:i,orientation:l,label:a=(0,N.__)("Block Patterns"),showTitlesAsTooltip:s}=e;const c=(0,ux.u)({orientation:l});return(0,v.createElement)(Dx.b,(0,Po.Z)({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>r.includes(e)?(0,v.createElement)(Mx,{key:e.name,pattern:e,onClick:i,onHover:o,isDraggable:t,composite:c,showTooltip:s}):(0,v.createElement)(Ox,{key:e.name}))))};function Fx(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r}=e;const o="block-editor-block-patterns-explorer__sidebar";return(0,v.createElement)("div",{className:`${o}__categories-list`},n.map((e=>{let{name:n,label:i}=e;return(0,v.createElement)(Mo.ZP,{key:n,label:i,className:`${o}__categories-list__item`,isPressed:t===n,onClick:()=>{r(n)}},i)})))}function jx(e){let{filterValue:t,setFilterValue:n}=e;return(0,v.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,v.createElement)(r_.Z,{__nextHasNoMarginBottom:!0,onChange:n,value:t,label:(0,N.__)("Search for patterns"),placeholder:(0,N.__)("Search")}))}var zx=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:r,filterValue:o,setFilterValue:i}=e;return(0,v.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,v.createElement)(jx,{filterValue:o,setFilterValue:i}),!o&&(0,v.createElement)(Fx,{selectedCategory:t,patternCategories:n,onClickCategory:r}))},Hx=function(){return(0,v.createElement)("div",{className:"block-editor-inserter__no-results"},(0,v.createElement)(om.Z,{className:"block-editor-inserter__no-results-icon",icon:__.Z}),(0,v.createElement)("p",null,(0,N.__)("No results found.")))},Vx=function(e){let{rootClientId:t="",insertionIndex:n,clientId:r,isAppender:o,onSelect:i,shouldFocusBlock:l=!0,selectBlockOnInsert:a=!0}=e;const{getSelectedBlock:s}=(0,E.Z)(ku),{destinationRootClientId:c,destinationIndex:u}=(0,E.Z)((e=>{const{getSelectedBlockClientId:i,getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s}=e(ku),c=i();let u,d=t;return void 0!==n?u=n:r?u=a(r):!o&&c?(d=l(c),u=a(c)+1):u=s(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,r,o]),{replaceBlocks:d,insertBlocks:p,showInsertionPoint:m,hideInsertionPoint:f}=(0,S.Z)(ku),h=(0,v.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=s();!o&&r&&Me(r)?d(r.clientId,e,null,l||n?0:null,t):p(e,u,c,a,l||n?0:null,t);const m=Array.isArray(e)?e.length:1,f=(0,N.sprintf)((0,N._n)("%d block added.","%d blocks added.",m),m);(0,fl.D)(f),i&&i(e)}),[o,s,d,p,c,u,i,l]),g=(0,v.useCallback)((e=>{e?m(c,u):f()}),[m,f,c,u]);return[c,h,g]},Wx=n(37066);const $x=e=>e.name||"",Ux=e=>e.title,Gx=e=>e.description||"",qx=e=>e.keywords||[],Kx=e=>e.category,Yx=()=>null;function Xx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,Wx.B)(e,{splitRegexp:[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],stripRegexp:/(\p{C}|\p{P}|\p{S})+/giu}).split(" ").filter(Boolean)}function Jx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=Qe()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Qx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Xx(Jx(e))},ew=(e,t)=>e.filter((e=>!Qx(t).some((t=>t.includes(e))))),tw=(e,t,n,r)=>{if(0===Qx(r).length)return e;const o={getCategory:e=>{var n;return null===(n=t.find((t=>{let{slug:n}=t;return n===e.category})))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}};return nw(e,r,o)},nw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Qx(t);if(0===r.length)return e;const o=e.map((e=>[e,rw(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return o.sort(((e,t)=>{let[,n]=e,[,r]=t;return r-n})),o.map((e=>{let[t]=e;return t}))};function rw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:r=$x,getTitle:o=Ux,getDescription:i=Gx,getKeywords:l=qx,getCategory:a=Kx,getCollection:s=Yx}=n,c=r(e),u=o(e),d=i(e),p=l(e),m=a(e),f=s(e),h=Jx(t),g=Jx(u);let v=0;if(h===g)v+=30;else if(g.startsWith(h))v+=20;else{const e=[c,u,d,...p,m,f].join(" "),t=Xx(h);0===ew(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function ow(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,v.createElement)(Lf.Z,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,N.sprintf)((0,N._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var iw=function(e){let{filterValue:t,selectedCategory:n,patternCategories:r}=e;const o=(0,uh.Z)(fl.D,500),[i,l]=Vx({shouldFocusBlock:!0}),[a,,s]=Ax(l,i),c=(0,v.useMemo)((()=>r.map((e=>e.name))),[r]),u=(0,v.useMemo)((()=>t?nw(a,t):a.filter((e=>{var t,r;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!c.includes(e))):null===(r=e.categories)||void 0===r?void 0:r.includes(n)}))),[t,n,a]);(0,v.useEffect)((()=>{if(!t)return;const e=u.length,n=(0,N.sprintf)((0,N._n)("%d result found.","%d results found.",e),e);o(n)}),[t,o]);const d=Wk(u,{step:2}),p=!(null==u||!u.length);return(0,v.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},p&&(0,v.createElement)(ow,{filterValue:t,filteredBlockPatternsLength:u.length}),(0,v.createElement)(dx,null,!p&&(0,v.createElement)(Hx,null),p&&(0,v.createElement)(Zx,{shownPatterns:d,blockPatterns:u,onClickPattern:s,isDraggable:!1})))};function lw(e){let{initialCategory:t,patternCategories:n}=e;const[r,o]=(0,v.useState)(""),[i,l]=(0,v.useState)(null==t?void 0:t.name);return(0,v.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,v.createElement)(zx,{selectedCategory:i,patternCategories:n,onClickCategory:l,filterValue:r,setFilterValue:o}),(0,v.createElement)(iw,{filterValue:r,selectedCategory:i,patternCategories:n}))}var aw=function(e){let{onModalClose:t,...n}=e;return(0,v.createElement)(Eh.Z,{title:(0,N.__)("Patterns"),onRequestClose:t,isFullScreen:!0},(0,v.createElement)(lw,n))},sw=n(50028),cw=n(52433);const uw=(0,v.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});var dw=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,v.useContext)(uw);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}};const pw=(0,Ku.Iq)((function(e,t){const n=function(e){const{onClick:t,as:n=Mo.ZP,goToParent:r=!1,...o}=(0,qu.y)(e,"NavigatorBackButton"),{goBack:i,goToParent:l}=dw(),a=(0,v.useCallback)((e=>{e.preventDefault(),r?l():i(),null==t||t(e)}),[r,l,i,t]);return{as:n,onClick:a,...o}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({ref:t},n))}),"NavigatorBackButton");var mw=pw;function fw(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,o=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var i=r[0],l=r.index,a=Object.create(null),s=function(e){if(void 0===r[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?a[n.name]=r[e].split(n.prefix+n.suffix).map((function(e){return o(e,n)})):a[n.name]=o(r[e],n)},c=1;c-1:void 0===w;o||(g+="(?:".concat(h,"(?=").concat(f,"))?")),C||(g+="(?=".concat(h,"|").concat(f,")"))}return new RegExp(g,gw(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||95===s))break;l+=e[a++]}if(!l)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:l}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i="[^".concat(hw(t.delimiter||"/#?"),"]+?"),l=[],a=0,s=0,c="",u=function(e){if(s)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return bw(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),gw(n))}(e,t,n):vw(e,t,n)}function yw(e,t){return fw(t,{decode:decodeURIComponent})(e)}function _w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"add":return[...e,t.screen];case"remove":return e.filter((e=>e.id!==t.screen.id))}return e}var kw={name:"15bx5k",styles:"overflow-x:hidden"};const xw=(0,Ku.Iq)((function(e,t){const{initialPath:n,children:r,className:o,...i}=(0,qu.y)(e,"NavigatorProvider"),[l,a]=(0,v.useState)([{path:n}]),s=(0,v.useRef)([]),[c,u]=(0,v.useReducer)(_w,[]),d=(0,v.useRef)([]);(0,v.useEffect)((()=>{d.current=c}),[c]),(0,v.useEffect)((()=>{s.current=l}),[l]);const p=(0,v.useRef)(),m=(0,v.useMemo)((()=>{let e;if(0===l.length||void 0===(e=l[l.length-1].path))return void(p.current=void 0);const t=(e=>{const t=function(e,t){for(const n of t){const t=yw(e,n.path);if(t)return{params:t.params,id:n.id}}}(e,c);return p.current&&t&&(0,fn.ZP)(t.params,p.current.params)&&t.id===p.current.id?p.current:t})(e);return p.current=t,t}),[c,l]),f=(0,v.useCallback)((e=>u({type:"add",screen:e})),[]),h=(0,v.useCallback)((e=>u({type:"remove",screen:e})),[]),g=(0,v.useCallback)((()=>{a((e=>e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]))}),[]),b=(0,v.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{focusTargetSelector:n,isBack:r=!1,...o}=t,i=r&&s.current.length>1&&s.current[s.current.length-2].path===e;i?g():a((t=>{const i={...o,path:e,isBack:r,hasRestoredFocus:!1};return t.length<1?[i]:[...t.slice(t.length>49?1:0,-1),{...t[t.length-1],focusTargetSelector:n},i]}))}),[g]),y=(0,v.useCallback)((()=>{const e=s.current[s.current.length-1].path;if(void 0===e)return;const t=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==yw(e,t.path)))&&(r=e)}return r}(e,d.current);void 0!==t&&b(t,{isBack:!0})}),[b]),_=(0,v.useMemo)((()=>({location:{...l[l.length-1],isInitial:1===l.length},params:m?m.params:{},match:m?m.id:void 0,goTo:b,goBack:g,goToParent:y,addScreen:f,removeScreen:h})),[l,m,b,g,y,f,h]),k=(0,Yu.I)(),x=(0,v.useMemo)((()=>k(kw,o)),[o,k]);return(0,v.createElement)(md.Z,(0,Po.Z)({ref:t,className:x},i),(0,v.createElement)(uw.Provider,{value:_},r))}),"NavigatorProvider");var ww=xw,Cw=n(61755),Ew={name:"14x3t6z",styles:"overflow-x:auto;max-height:100%"};const Sw=(0,Ku.Iq)((function(e,t){const n=(0,v.useId)(),{children:r,className:o,path:i,...l}=(0,qu.y)(e,"NavigatorScreen"),a=(0,by.Z)(),{location:s,match:c,addScreen:u,removeScreen:d}=(0,v.useContext)(uw),p=c===n,m=(0,v.useRef)(null);(0,v.useEffect)((()=>{const e={id:n,path:(0,Ji.kb)(i)};return u(e),()=>d(e)}),[n,i,u,d]);const f=(0,Yu.I)(),h=(0,v.useMemo)((()=>f(Ew,o)),[o,f]),g=(0,v.useRef)(s);(0,v.useEffect)((()=>{g.current=s}),[s]);const b=s.isInitial&&!s.isBack;(0,v.useEffect)((()=>{if(b||!p||!m.current||g.current.hasRestoredFocus)return;const e=m.current.ownerDocument.activeElement;if(m.current.contains(e))return;let t=null;if(s.isBack&&null!=s&&s.focusTargetSelector&&(t=m.current.querySelector(s.focusTargetSelector)),!t){const e=wy.focus.tabbable.find(m.current)[0];t=null!=e?e:m.current}g.current.hasRestoredFocus=!0,t.focus()}),[b,p,s.isBack,s.focusTargetSelector]);const y=(0,vl.Z)([t,m]);if(!p)return null;if(a)return(0,v.createElement)(md.Z,(0,Po.Z)({ref:y,className:h},l),r);const _={opacity:0,x:(0,N.isRTL)()&&s.isBack||!(0,N.isRTL)()&&!s.isBack?50:-50},k={animate:{opacity:1,transition:{delay:0,duration:.14,ease:"easeInOut"},x:0},exit:{delay:0,opacity:0,x:!(0,N.isRTL)()&&s.isBack||(0,N.isRTL)()&&!s.isBack?50:-50,transition:{duration:.14,ease:"easeInOut"}},initial:_};return(0,v.createElement)(Cw.E.div,(0,Po.Z)({ref:y,className:h},l,k),r)}),"NavigatorScreen");var Iw=Sw;const Tw=(0,Ku.Iq)((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Mo.ZP,attributeName:o="id",...i}=(0,qu.y)(e,"NavigatorButton"),l=(0,Ji.kb)(t),{goTo:a}=dw(),s=(0,v.useCallback)((e=>{var t,r;e.preventDefault(),a(l,{focusTargetSelector:(t=o,r=l,`[${t}="${r}"]`)}),null==n||n(e)}),[a,n,o,l]);return{as:r,onClick:s,...i,[o]:l}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({ref:t},n))}),"NavigatorButton");var Nw=Tw;function Bw(e){let{title:t}=e;return(0,v.createElement)(sw.Z,{spacing:0},(0,v.createElement)(md.Z,null,(0,v.createElement)(cw.Z,{marginBottom:0,paddingX:4,paddingY:3},(0,v.createElement)(Bf.Z,{spacing:2},(0,v.createElement)(mw,{style:{minWidth:24,padding:0},icon:(0,N.isRTL)()?b_.Z:y_.Z,isSmall:!0,"aria-label":(0,N.__)("Navigate to the previous view")}),(0,v.createElement)(cw.Z,null,(0,v.createElement)(Lf.Z,{level:5},t))))))}function Lw(e){let{categories:t,children:n}=e;return(0,v.createElement)(ww,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation"},(0,v.createElement)(Iw,{path:"/"},(0,v.createElement)(Nx,null,t.map((e=>(0,v.createElement)(Nw,{key:e.name,path:`/category/${e.name}`,as:Bx,isAction:!0},(0,v.createElement)(Bf.Z,null,(0,v.createElement)(Lx.Z,null,e.label),(0,v.createElement)(om.Z,{icon:(0,N.isRTL)()?y_.Z:b_.Z}))))))),t.map((e=>(0,v.createElement)(Iw,{key:e.name,path:`/category/${e.name}`},(0,v.createElement)(Bw,{title:(0,N.__)("Back")}),n(e)))))}const Pw=["featured","posts","text","gallery","call-to-action","banner","header","footer"];function Aw(e){const[t,n]=Ax(void 0,e),r=(0,v.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>n.some((t=>t.name===e))))),[n]),o=(0,v.useMemo)((()=>{const e=n.filter((e=>t.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:r}=t,o=Pw.indexOf(n),i=Pw.indexOf(r);return o<0&&(o=Pw.length),i<0&&(i=Pw.length),o-i}));return t.some((e=>!r(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,N._x)("Uncategorized")}),e}),[t,n]);return o}function Dw(e){let{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}=e;const l=(0,v.useRef)();return(0,v.useEffect)((()=>{const e=setTimeout((()=>{const[e]=wy.focus.tabbable.find(l.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[o]),(0,v.createElement)("div",{ref:l,className:"block-editor-inserter__patterns-category-dialog"},(0,v.createElement)(Rw,{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}))}function Rw(e){let{rootClientId:t,onInsert:n,onHover:r,category:o,showTitlesAsTooltip:i}=e;const[l,,a]=Ax(n,t),s=Aw(t),c=(0,v.useMemo)((()=>l.filter((e=>{var t,n,r;return"uncategorized"!==o.name?null===(r=e.categories)||void 0===r?void 0:r.includes(o.name):0===(null!==(t=null===(n=e.categories)||void 0===n?void 0:n.filter((e=>s.find((t=>t.name===e)))))&&void 0!==t?t:[]).length}))),[l,o]),u=Wk(c);return(0,v.useEffect)((()=>()=>r(null)),[]),c.length?(0,v.createElement)("div",{className:"block-editor-inserter__patterns-category-panel"},(0,v.createElement)("div",{className:"block-editor-inserter__patterns-category-panel-title"},o.label),(0,v.createElement)("p",null,o.description),(0,v.createElement)(Zx,{shownPatterns:u,blockPatterns:c,onClickPattern:a,onHover:r,label:o.label,orientation:"vertical",category:o.label,isDraggable:!0,showTitlesAsTooltip:i})):null}var Mw=function(e){let{onSelectCategory:t,selectedCategory:n,onInsert:r,rootClientId:o}=e;const[i,l]=(0,v.useState)(!1),a=Aw(o),s=n||a[0],c=(0,ch.Z)("medium","<");return(0,v.createElement)(v.Fragment,null,!c&&(0,v.createElement)("div",{className:"block-editor-inserter__block-patterns-tabs-container"},(0,v.createElement)("nav",{"aria-label":(0,N.__)("Block pattern categories")},(0,v.createElement)(Nx,{role:"list",className:"block-editor-inserter__block-patterns-tabs"},a.map((e=>(0,v.createElement)(Bx,{role:"listitem",key:e.name,onClick:()=>t(e),className:e===n?"block-editor-inserter__patterns-category block-editor-inserter__patterns-selected-category":"block-editor-inserter__patterns-category","aria-label":e.label,"aria-current":e===n?"true":void 0},(0,v.createElement)(Bf.Z,null,(0,v.createElement)(Lx.Z,null,e.label),(0,v.createElement)(om.Z,{icon:b_.Z}))))),(0,v.createElement)("div",{role:"listitem"},(0,v.createElement)(Mo.ZP,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>l(!0),variant:"secondary"},(0,N.__)("Explore all patterns")))))),c&&(0,v.createElement)(Lw,{categories:a},(e=>(0,v.createElement)(Rw,{onInsert:r,rootClientId:o,category:e,showTitlesAsTooltip:!1}))),i&&(0,v.createElement)(aw,{initialCategory:s,patternCategories:a,onModalClose:()=>l(!1)}))},Ow=n(15312);function Zw(e){let{onHover:t,onInsert:n,rootClientId:r}=e;const[o,,,i]=cx(r,n),l=(0,v.useMemo)((()=>o.filter((e=>{let{category:t}=e;return"reusable"===t}))),[o]);return 0===l.length?(0,v.createElement)(Hx,null):(0,v.createElement)(sx,{title:(0,N.__)("Reusable blocks")},(0,v.createElement)(ax,{items:l,onSelect:i,onHover:t,label:(0,N.__)("Reusable blocks")}))}var Fw=function(e){let{rootClientId:t,onInsert:n,onHover:r}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Zw,{onHover:r,onInsert:n,rootClientId:t}),(0,v.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,v.createElement)(Mo.ZP,{className:"block-editor-inserter__manage-reusable-blocks",variant:"secondary",href:(0,Ow.f)("edit.php",{post_type:"wp_block"})},(0,N.__)("Manage Reusable blocks"))))};function jw(e){const[t,n]=(0,v.useState)([]),{canInsertImage:r,canInsertVideo:o,canInsertAudio:i}=(0,E.Z)((t=>{const{canInsertBlockType:n}=t(ku);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]),l=function(){const{inserterMediaCategories:e,allowedMimeTypes:t,enableOpenverseMediaCategory:n}=(0,E.Z)((e=>{const t=e(ku).getSettings();return{inserterMediaCategories:t.inserterMediaCategories,allowedMimeTypes:t.allowedMimeTypes,enableOpenverseMediaCategory:t.enableOpenverseMediaCategory}}),[]),r=(0,v.useMemo)((()=>{if(e&&t)return e.filter((e=>!(!n&&"openverse"===e.name)&&Object.values(t).some((t=>t.startsWith(`${e.mediaType}/`)))))}),[e,t,n]);return r}();return(0,v.useEffect)((()=>{(async()=>{const e=[];if(!l)return;const t=new Map(await Promise.all(l.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:r,video:o,audio:i};l.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[r,o,i,l]),t}var zw=n(73985),Hw=n(6198);const Vw={image:"img",video:"video",audio:"audio"};function Ww(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},r=e.url,o=e.alt||void 0;"image"===t?(n.url=r,n.alt=o):["video","audio"].includes(t)&&(n.src=r);const i=Vw[t],l=(0,v.createElement)(i,{src:e.previewUrl||r,alt:o,controls:"audio"===t||void 0,inert:"true",onError:t=>{let{currentTarget:n}=t;n.src===e.previewUrl&&(n.src=r)}});return[ke(`core/${t}`,n),l]}const $w=["image"],Uw={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Gw(e){let{category:t,media:n}=e;if(!t.getReportUrl)return null;const r=t.getReportUrl(n);return(0,v.createElement)(zo.Z,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,N.__)("Options"),popoverProps:Uw,icon:Nf.Z},(()=>(0,v.createElement)(Ou.Z,null,(0,v.createElement)(Zu.Z,{onClick:()=>window.open(r,"_blank").focus(),icon:Hw.Z},(0,N.sprintf)((0,N.__)("Report %s"),t.mediaType)))))}function qw(e){let{onClose:t,onSubmit:n}=e;return(0,v.createElement)(Eh.Z,{title:(0,N.__)("Insert external image"),onRequestClose:t,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal"},(0,v.createElement)(sw.Z,{spacing:3},(0,v.createElement)("p",null,(0,N.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")),(0,v.createElement)("p",null,(0,N.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation."))),(0,v.createElement)(Uu.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{variant:"tertiary",onClick:t},(0,N.__)("Cancel"))),(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{variant:"primary",onClick:n},(0,N.__)("Insert")))))}function Kw(e){var t;let{media:n,onClick:r,composite:o,category:i}=e;const[l,a]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[p,m]=(0,v.useMemo)((()=>Ww(n,i.mediaType)),[n,i.mediaType]),{createErrorNotice:f,createSuccessNotice:h}=(0,S.Z)(Px.h),g=(0,E.Z)((e=>e(ku).getSettings().mediaUpload),[]),b=(0,v.useCallback)((e=>{if(u)return;const t=Ce(e),{id:n,url:o,caption:i}=t.attributes;n?r(t):(d(!0),window.fetch(o).then((e=>e.blob())).then((e=>{g({filesList:[e],additionalData:{caption:i},onFileChange(e){let[n]=e;j(n.url)||(r({...t,attributes:{...t.attributes,id:n.id,url:n.url}}),h((0,N.__)("Image uploaded and inserted."),{type:"snackbar"}),d(!1))},allowedTypes:$w,onError(e){f(e,{type:"snackbar"}),d(!1)}})})).catch((()=>{a(!0),d(!1)})))}),[u,r,g,f,h]),y=(null===(t=n.title)||void 0===t?void 0:t.rendered)||n.title;let _;if(y.length>25){const e="...";_=y.slice(0,25-e.length)+e}const k=(0,v.useCallback)((()=>c(!0)),[]),x=(0,v.useCallback)((()=>c(!1)),[]);return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(nx,{isEnabled:!0,blocks:[p]},(e=>{let{draggable:t,onDragStart:r,onDragEnd:l}=e;return(0,v.createElement)("div",{className:w()("block-editor-inserter__media-list__list-item",{"is-hovered":s}),draggable:t,onDragStart:r,onDragEnd:l},(0,v.createElement)(Ld.Z,{text:_||y},(0,v.createElement)("div",{onMouseEnter:k,onMouseLeave:x},(0,v.createElement)(qk.A,(0,Po.Z)({role:"option",as:"div"},o,{className:"block-editor-inserter__media-list__item",onClick:()=>b(p),"aria-label":y}),(0,v.createElement)("div",{className:"block-editor-inserter__media-list__item-preview"},m,u&&(0,v.createElement)("div",{className:"block-editor-inserter__media-list__item-preview-spinner"},(0,v.createElement)(zw.ZP,null)))),!u&&(0,v.createElement)(Gw,{category:i,media:n}))))})),l&&(0,v.createElement)(qw,{onClose:()=>a(!1),onSubmit:()=>{r(Ce(p)),h((0,N.__)("Image inserted."),{type:"snackbar"}),a(!1)}}))}var Yw=function(e){let{mediaList:t,category:n,onClick:r,label:o=(0,N.__)("Media List")}=e;const i=(0,ux.u)();return(0,v.createElement)(Dx.b,(0,Po.Z)({},i,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":o}),t.map(((e,t)=>(0,v.createElement)(Kw,{key:e.id||e.sourceId||t,media:e,category:n,onClick:r,composite:i}))))};function Xw(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=(0,v.useState)(e),[r,o]=(0,v.useState)(e),i=(0,uh.Z)(o,250);return(0,v.useEffect)((()=>{r!==t&&i(t)}),[r,t]),[t,n,r]}function Jw(e){let{rootClientId:t,onInsert:n,category:r}=e;const o=(0,v.useRef)();return(0,v.useEffect)((()=>{const e=setTimeout((()=>{const[e]=wy.focus.tabbable.find(o.current);null==e||e.focus()}));return()=>clearTimeout(e)}),[r]),(0,v.createElement)("div",{ref:o,className:"block-editor-inserter__media-dialog"},(0,v.createElement)(Qw,{rootClientId:t,onInsert:n,category:r}))}function Qw(e){let{rootClientId:t,onInsert:n,category:r}=e;const[o,i,l]=Xw(),{mediaList:a,isLoading:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,r]=(0,v.useState)(),[o,i]=(0,v.useState)(!1),l=(0,v.useRef)();return(0,v.useEffect)((()=>{(async()=>{var n;const o=JSON.stringify({category:e.name,...t});l.current=o,i(!0),r([]);const a=await(null===(n=e.fetch)||void 0===n?void 0:n.call(e,t));o===l.current&&(r(a),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:o}}(r,{per_page:l?20:10,search:l}),c="block-editor-inserter__media-panel",u=r.labels.search_items||(0,N.__)("Search");return(0,v.createElement)("div",{className:c},(0,v.createElement)(r_.Z,{className:`${c}-search`,onChange:i,value:o,label:u,placeholder:u}),s&&(0,v.createElement)("div",{className:`${c}-spinner`},(0,v.createElement)(zw.ZP,null)),!s&&!(null!=a&&a.length)&&(0,v.createElement)(Hx,null),!s&&!(null==a||!a.length)&&(0,v.createElement)(Yw,{rootClientId:t,onClick:n,mediaList:a,category:r}))}var eC=function(e){let{fallback:t=null,children:n}=e;const r=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return!!t().mediaUpload}),[]);return r?n:t},tC=ph("editor.MediaUpload")((()=>null));const nC=["image","video","audio"];var rC=function(e){let{rootClientId:t,selectedCategory:n,onSelectCategory:r,onInsert:o}=e;const i=jw(t),l=(0,ch.Z)("medium","<"),a="block-editor-inserter__media-tabs",s=(0,v.useCallback)((e=>{if(null==e||!e.url)return;const[t]=Ww(e,e.type);o(t)}),[o]),c=(0,v.useMemo)((()=>i.map((e=>({...e,label:e.labels.name})))),[i]);return(0,v.createElement)(v.Fragment,null,!l&&(0,v.createElement)("div",{className:`${a}-container`},(0,v.createElement)("nav",{"aria-label":(0,N.__)("Media categories")},(0,v.createElement)(Nx,{role:"list",className:a},i.map((e=>(0,v.createElement)(Bx,{role:"listitem",key:e.name,onClick:()=>r(e),className:w()(`${a}__media-category`,{"is-selected":n===e}),"aria-label":e.labels.name,"aria-current":e===n?"true":void 0},(0,v.createElement)(Bf.Z,null,(0,v.createElement)(Lx.Z,null,e.labels.name),(0,v.createElement)(om.Z,{icon:b_.Z}))))),(0,v.createElement)("div",{role:"listitem"},(0,v.createElement)(eC,null,(0,v.createElement)(tC,{multiple:!1,onSelect:s,allowedTypes:nC,render:e=>{let{open:t}=e;return(0,v.createElement)(Mo.ZP,{onClick:e=>{e.target.focus(),t()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal"},(0,N.__)("Open Media Library"))}})))))),l&&(0,v.createElement)(Lw,{categories:c},(e=>(0,v.createElement)(Qw,{onInsert:o,rootClientId:t,category:e}))))};const{Fill:oC,Slot:iC}=(0,I.up)("__unstableInserterMenuExtension");oC.Slot=iC;var lC=oC;const aC=[];var sC=function(e){let{filterValue:t,onSelect:n,onHover:r,rootClientId:o,clientId:i,isAppender:l,__experimentalInsertionIndex:a,maxBlockPatterns:s,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:p=!0,prioritizePatterns:m,selectBlockOnInsert:f}=e;const h=(0,uh.Z)(fl.D,500),[g,b]=Vx({onSelect:n,rootClientId:o,clientId:i,isAppender:l,insertionIndex:a,shouldFocusBlock:p,selectBlockOnInsert:f}),[y,_,k,x]=cx(g,b),[w,,C]=Ax(b,g),E=(0,v.useMemo)((()=>{if(0===s)return[];const e=nw(w,t);return void 0!==s?e.slice(0,s):e}),[t,w,s]);let S=c;m&&E.length>2&&(S=0);const I=(0,v.useMemo)((()=>{if(0===S)return[];const e=tw(Wl(y,"frecency","desc"),_,k,t);return void 0!==S?e.slice(0,S):e}),[t,y,_,k,c]);(0,v.useEffect)((()=>{if(!t)return;const e=I.length+E.length,n=(0,N.sprintf)((0,N._n)("%d result found.","%d results found.",e),e);h(n)}),[t,h]);const T=Wk(I,{step:9}),B=Wk(T.length===I.length?E:aC),L=I.length>0||E.length>0,P=!!I.length&&(0,v.createElement)(sx,{title:(0,v.createElement)(n_.Z,null,(0,N.__)("Blocks"))},(0,v.createElement)(ax,{items:T,onSelect:x,onHover:r,label:(0,N.__)("Blocks"),isDraggable:d})),A=!!E.length&&(0,v.createElement)(sx,{title:(0,v.createElement)(n_.Z,null,(0,N.__)("Block Patterns"))},(0,v.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,v.createElement)(Zx,{shownPatterns:B,blockPatterns:E,onClickPattern:C,onHover:r,isDraggable:d})));return(0,v.createElement)(dx,null,!u&&!L&&(0,v.createElement)(Hx,null),m?A:P,!!I.length&&!!E.length&&(0,v.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),m?P:A,u&&(0,v.createElement)(lC.Slot,{fillProps:{onSelect:x,onHover:r,filterValue:t,hasItems:L,rootClientId:g}},(e=>e.length?e:L?null:(0,v.createElement)(Hx,null))))},cC=n(35835);const uC={name:"blocks",title:(0,N.__)("Blocks")},dC={name:"patterns",title:(0,N.__)("Patterns")},pC={name:"reusable",title:(0,N.__)("Reusable"),icon:ui.Z},mC={name:"media",title:(0,N.__)("Media")};var fC=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:r=!1,showMedia:o=!1,onSelect:i,prioritizePatterns:l}=e;const a=(0,v.useMemo)((()=>{const e=[];return l&&n&&e.push(dC),e.push(uC),!l&&n&&e.push(dC),o&&e.push(mC),r&&e.push(pC),e}),[l,uC,n,dC,r,o,pC]);return(0,v.createElement)(cC.Z,{className:"block-editor-inserter__tabs",tabs:a,onSelect:i},t)},hC=(0,v.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,onSelect:l,showInserterHelpPanel:a,showMostUsedBlocks:s,__experimentalFilterValue:c="",shouldFocusBlock:u=!0,prioritizePatterns:d}=e;const[p,m,f]=Xw(c),[h,g]=(0,v.useState)(null),[b,y]=(0,v.useState)(null),[_,k]=(0,v.useState)(null),[x,C]=(0,v.useState)(null),[S,I,T]=Vx({rootClientId:n,clientId:r,isAppender:o,insertionIndex:i,shouldFocusBlock:u}),{showPatterns:B,inserterItems:L}=(0,E.Z)((e=>{const{__experimentalGetAllowedPatterns:t,getInserterItems:n}=e(ku);return{showPatterns:!!t(S).length,inserterItems:n(S)}}),[S]),P=(0,v.useMemo)((()=>L.some((e=>{let{category:t}=e;return"reusable"===t}))),[L]),A=!!jw(S).length,D=(0,v.useCallback)(((e,t,n)=>{I(e,t,n),l()}),[I,l]),R=(0,v.useCallback)(((e,t)=>{I(e,{patternName:t}),l()}),[I,l]),M=(0,v.useCallback)((e=>{T(!!e),g(e)}),[T,g]),O=(0,v.useCallback)((e=>{T(!!e)}),[T]),Z=(0,v.useCallback)((e=>{y(e)}),[y]),F=(0,v.useMemo)((()=>(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{className:"block-editor-inserter__block-list"},(0,v.createElement)(mx,{rootClientId:S,onInsert:D,onHover:M,showMostUsedBlocks:s})),a&&(0,v.createElement)("div",{className:"block-editor-inserter__tips"},(0,v.createElement)(n_.Z,{as:"h2"},(0,N.__)("A tip for using the block editor")),(0,v.createElement)(v_,null)))),[S,D,M,f,s,a]),j=(0,v.useMemo)((()=>(0,v.createElement)(Mw,{rootClientId:S,onInsert:R,onSelectCategory:Z,selectedCategory:b})),[S,R,Z,b]),z=(0,v.useMemo)((()=>(0,v.createElement)(Fw,{rootClientId:S,onInsert:D,onHover:M})),[S,D,M]),H=(0,v.useMemo)((()=>(0,v.createElement)(rC,{rootClientId:S,selectedCategory:_,onSelectCategory:k,onInsert:D})),[S,D,_,k]),V=(0,v.useCallback)((e=>"blocks"===e.name?F:"patterns"===e.name?j:"reusable"===e.name?z:"media"===e.name?H:void 0),[F,j,z,H]),W=(0,v.useRef)();(0,v.useImperativeHandle)(t,(()=>({focusSearch:()=>{W.current.focus()}})));const $="patterns"===x&&!f&&b,U=!f&&(B||P||A),G="media"===x&&!f&&_;return(0,v.createElement)("div",{className:"block-editor-inserter__menu"},(0,v.createElement)("div",{className:w()("block-editor-inserter__main-area",{"show-as-tabs":U})},(0,v.createElement)(r_.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{h&&g(null),m(e)},value:p,label:(0,N.__)("Search for blocks and patterns"),placeholder:(0,N.__)("Search"),ref:W}),!!f&&(0,v.createElement)("div",{className:"block-editor-inserter__no-tab-container"},(0,v.createElement)(sC,{filterValue:f,onSelect:l,onHover:M,rootClientId:n,clientId:r,isAppender:o,__experimentalInsertionIndex:i,showBlockDirectory:!0,shouldFocusBlock:u})),U&&(0,v.createElement)(fC,{showPatterns:B,showReusableBlocks:P,showMedia:A,prioritizePatterns:d,onSelect:C},V),!f&&!U&&(0,v.createElement)("div",{className:"block-editor-inserter__no-tab-container"},F)),G&&(0,v.createElement)(Jw,{rootClientId:S,onInsert:D,category:_}),a&&h&&(0,v.createElement)(zk,{item:h}),$&&(0,v.createElement)(Dw,{rootClientId:S,onInsert:R,onHover:O,category:b,showTitlesAsTooltip:!0}))}));function gC(e){let{onSelect:t,rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:i,selectBlockOnInsert:l}=e;const[a,s]=(0,v.useState)(""),[c,u]=Vx({onSelect:t,rootClientId:n,clientId:r,isAppender:o,selectBlockOnInsert:l}),[d]=cx(c,u),[p]=Ax(u,c),{setInserterIsOpened:m,insertionIndex:f}=(0,E.Z)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:o}=e(ku),i=t(),l=n(r),a=o();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===l?a:l}}),[r]),h=p.length&&(!!a||i),g=h&&p.length>6||d.length>6;(0,v.useEffect)((()=>{m&&m(!1)}),[m]);let b=0;return h&&(b=i?4:2),(0,v.createElement)("div",{className:w()("block-editor-inserter__quick-inserter",{"has-search":g,"has-expand":m})},g&&(0,v.createElement)(r_.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:a,onChange:e=>{s(e)},label:(0,N.__)("Search for blocks and patterns"),placeholder:(0,N.__)("Search")}),(0,v.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,v.createElement)(sC,{filterValue:a,onSelect:t,rootClientId:n,clientId:r,isAppender:o,maxBlockPatterns:b,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:i,selectBlockOnInsert:l})),m&&(0,v.createElement)(Mo.ZP,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{m({rootClientId:n,insertionIndex:f,filterValue:a})},"aria-label":(0,N.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,N.__)("Browse all")))}const vC=e=>{let t,{onToggle:n,disabled:r,isOpen:o,blockTitle:i,hasSingleBlockType:l,toggleProps:a={},prioritizePatterns:s}=e;t=l?(0,N.sprintf)((0,N._x)("Add %s","directly add the only allowed block"),i):s?(0,N.__)("Add pattern"):(0,N._x)("Add block","Generic label for block inserter button");const{onClick:c,...u}=a;return(0,v.createElement)(Mo.ZP,(0,Po.Z)({icon:Tf.Z,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),c&&c(e)},className:"block-editor-inserter__toggle","aria-haspopup":!l&&"true","aria-expanded":!l&&o,disabled:r},u))};class bC extends v.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:r,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,hasItems:s,renderToggle:c=vC,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:r||!s,blockTitle:o,hasSingleBlockType:i,directInsertBlock:l,toggleProps:a,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,__experimentalIsQuick:l,prioritizePatterns:a,onSelectOrClose:s,selectBlockOnInsert:c}=this.props;return l?(0,v.createElement)(gC,{onSelect:e=>{const n=Array.isArray(e)&&null!=e&&e.length?e[0]:e;s&&"function"==typeof s&&s(n),t()},rootClientId:n,clientId:r,isAppender:o,prioritizePatterns:a,selectBlockOnInsert:c}):(0,v.createElement)(hC,{onSelect:()=>{t()},rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,prioritizePatterns:a})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:r,__experimentalIsQuick:o,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:r}):(0,v.createElement)(t_.Z,{className:"block-editor-inserter",contentClassName:w()("block-editor-inserter__popover",{"is-quick":o}),popoverProps:{position:e},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,N.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}var yC=(0,hh.Z)([(0,mh.Z)(((e,t)=>{var n;let{clientId:r,rootClientId:o,shouldDirectInsert:i=!0}=t;const{getBlockRootClientId:l,hasInserterItems:a,getAllowedBlocks:s,__experimentalGetDirectInsertBlock:c,getSettings:u}=e(ku),{getBlockVariations:d}=e(Xt);o=o||l(r)||void 0;const p=s(o),m=i&&c(o),f=u(),h=1===(null==p?void 0:p.length)&&0===(null===(n=d(p[0].name,"inserter"))||void 0===n?void 0:n.length);let g=!1;return h&&(g=p[0]),{hasItems:a(o),hasSingleBlockType:h,blockTitle:g?g.title:"",allowedBlockType:g,directInsertBlock:m,rootClientId:o,prioritizePatterns:f.__experimentalPreferPatternsOnRoot&&!o}})),(0,fh.Z)(((e,t,n)=>{let{select:r}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:o,isAppender:i,hasSingleBlockType:l,allowedBlockType:a,directInsertBlock:s,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!l&&!s)return;const{insertBlock:d}=e(ku);let p;if(s){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=r(ku);if(!e||!o&&!n)return{};const l={};let a={};if(o){const e=t(o),n=t(i(o));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(a=(null==n?void 0:n.attributes)||{})}else{var c;const e=t(n);if(null!=e&&null!==(c=e.innerBlocks)&&void 0!==c&&c.length){const t=e.innerBlocks[e.innerBlocks.length-1];s&&(null==s?void 0:s.name)===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(l[e]=a[e])})),l}(s.attributesToCopy);p=ke(s.name,{...s.attributes||{},...e})}else p=ke(a.name);var m;d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:l,getBlockRootClientId:a}=r(ku);if(o)return e(o);const s=t();return!i&&s&&a(s)===n?e(s)+1:l(n).length}(),n,u),c&&c({clientId:null===(m=p)||void 0===m?void 0:m.clientId});const f=(0,N.sprintf)((0,N.__)("%s block added"),a.title);(0,fl.D)(f)}}})),vh((e=>{let{hasItems:t,isAppender:n,rootClientId:r,clientId:o}=e;return t||!n&&!r&&!o}))])(bC),_C=(0,hh.Z)((0,mh.Z)(((e,t)=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=e(ku),i=!n(t.rootClientId),{bodyPlaceholder:l}=r();return{showPrompt:i,isLocked:!!o(t.rootClientId),placeholder:l}})),(0,fh.Z)(((e,t)=>{const{insertDefaultBlock:n,startTyping:r}=e(ku);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),r()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:r,placeholder:o,rootClientId:i}=e;if(t)return null;const l=(0,Dn.decodeEntities)(o)||(0,N.__)("Type / to choose a block");return(0,v.createElement)("div",{"data-root-client-id":i||"",className:w()("block-editor-default-block-appender",{"has-visible-prompt":r})},(0,v.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,N.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Al.ENTER!==e.keyCode&&Al.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{r&&n()}},r?l:"\ufeff"),(0,v.createElement)(yC,{rootClientId:i,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function kC(e,t){let{rootClientId:n,className:r,onFocus:o,tabIndex:i}=e;return(0,v.createElement)(yC,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:l,disabled:a,isOpen:s,blockTitle:c,hasSingleBlockType:u}=e;n=u?(0,N.sprintf)((0,N._x)("Add %s","directly add the only allowed block"),c):(0,N._x)("Add block","Generic label for block inserter button");const d=!u;let p=(0,v.createElement)(Mo.ZP,{ref:t,onFocus:o,tabIndex:i,className:w()(r,"block-editor-button-block-appender"),onClick:l,"aria-haspopup":d?"true":void 0,"aria-expanded":d?s:void 0,disabled:a,label:n},!u&&(0,v.createElement)(n_.Z,{as:"span"},n),(0,v.createElement)(om.Z,{icon:Tf.Z}));return(d||u)&&(p=(0,v.createElement)(Ld.Z,{text:n},p)),p},isAppender:!0})}(0,v.forwardRef)(((e,t)=>((0,St.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),kC(e,t))));var xC=(0,v.forwardRef)(kC);function wC(e){let{rootClientId:t}=e;return(0,E.Z)((e=>e(ku).canInsertBlockType(de(),t)))?(0,v.createElement)(_C,{rootClientId:t}):(0,v.createElement)(xC,{rootClientId:t,className:"block-list-appender__toggle"})}var CC=function(e){let{rootClientId:t,renderAppender:n,className:r,tagName:o="div"}=e;const i=function(e,t){const{hideInserter:n,isParentSelected:r}=(0,E.Z)((t=>{const{getTemplateLock:n,getSelectedBlockClientId:r,__unstableGetEditorMode:o}=t(ku),i=r();return{hideInserter:!!n(e)||"zoom-out"===o(),isParentSelected:e===i||!e&&!i}}),[e]);return n||!1===t?null:t?(0,v.createElement)(t,null):r?(0,v.createElement)(wC,{rootClientId:e}):null}(t,n);return i?(0,v.createElement)(o,{tabIndex:-1,className:w()("block-list-appender wp-block",r),contentEditable:!1,"data-block":!0},i):null},EC=function(e){return(0,bl.Z)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])};const SC=Number.MAX_SAFE_INTEGER;(0,v.createContext)();var IC=function(e){let{previousClientId:t,nextClientId:n,children:r,__unstablePopoverSlot:o,__unstableContentRef:i,...l}=e;const[a,s]=(0,v.useReducer)((e=>(e+1)%SC),0),{orientation:c,rootClientId:u,isVisible:d}=(0,E.Z)((e=>{var r;const{getBlockListSettings:o,getBlockRootClientId:i,isBlockVisible:l}=e(ku),a=i(null!=t?t:n);return{orientation:(null===(r=o(a))||void 0===r?void 0:r.orientation)||"vertical",rootClientId:a,isVisible:l(t)&&l(n)}}),[t,n]),p=Uy(t),m=Uy(n),f="vertical"===c,h=(0,v.useMemo)((()=>{if(a<0||!p&&!m||!d)return;const{ownerDocument:e}=p||m;return{ownerDocument:e,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=m?m.getBoundingClientRect():null;let n=0,r=0,o=0,i=0;return f?(r=e?e.bottom:t.top,o=e?e.width:t.width,i=t&&e?t.top-e.bottom:0,n=(0,N.isRTL)()?e?e.right:t.right:e?e.left:t.left):(r=e?e.top:t.top,i=e?e.height:t.height,(0,N.isRTL)()?(n=e?e.left:t.right,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0)),new window.DOMRect(n,r,o,i)}}}),[p,m,a,f,d]),g=EC(i);return(0,v.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(s);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,v.useLayoutEffect)((()=>{if(!m)return;const e=new window.MutationObserver(s);return e.observe(m,{attributes:!0}),()=>{e.disconnect()}}),[m]),(0,v.useLayoutEffect)((()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",s),()=>{var e;null===(e=p.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",s)}}),[p]),(p||m)&&d?(0,v.createElement)(T.Z,(0,Po.Z)({ref:g,animate:!1,anchor:h,focusOnMount:!1,__unstableSlotName:o||null,key:n+"--"+u},l,{className:w()("block-editor-block-popover","block-editor-block-popover__inbetween",l.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled"}),(0,v.createElement)("div",{className:"block-editor-block-popover__inbetween-container"},r)):null};const TC=Number.MAX_SAFE_INTEGER;var NC=(0,v.forwardRef)((function(e,t){let{clientId:n,bottomClientId:r,children:o,__unstableRefreshSize:i,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:s,shift:c=!0,...u}=e;const d=Uy(n),p=Uy(null!=r?r:n),m=(0,vl.Z)([t,EC(s)]),[f,h]=(0,v.useReducer)((e=>(e+1)%TC),0);(0,v.useLayoutEffect)((()=>{if(!d)return;const e=new window.MutationObserver(h);return e.observe(d,{attributes:!0}),()=>{e.disconnect()}}),[d]);const g=(0,v.useMemo)((()=>f<0||!d||p!==d?{}:{position:"absolute",width:d.offsetWidth,height:d.offsetHeight}),[d,p,i,f]),b=(0,v.useMemo)((()=>{if(!(f<0||!d||r&&!p))return{getBoundingClientRect(){var e,t,n,r;const o=d.getBoundingClientRect(),i=null==p?void 0:p.getBoundingClientRect(),l=Math.min(o.left,null!==(e=null==i?void 0:i.left)&&void 0!==e?e:1/0),a=Math.min(o.top,null!==(t=null==i?void 0:i.top)&&void 0!==t?t:1/0),s=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-l,c=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-a;return new window.DOMRect(l,a,s,c)},ownerDocument:d.ownerDocument}}),[r,p,d,f]);return!d||r&&!p?null:(0,v.createElement)(T.Z,(0,Po.Z)({ref:m,animate:!1,focusOnMount:!1,anchor:b,__unstableSlotName:a||null,placement:"top-start",resize:!1,flip:!1,shift:c},u,{className:w()("block-editor-block-popover",u.className),variant:"unstyled"}),l&&(0,v.createElement)("div",{style:g},o),!l&&o)}));const BC={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};var LC=function(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{clientId:r}=(0,E.Z)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(ku),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),o=(0,by.Z)();return(0,v.createElement)(NC,{clientId:r,__unstableCoverTarget:!0,__unstablePopoverSlot:t,__unstableContentRef:n,className:"block-editor-block-popover__drop-zone"},(0,v.createElement)(Cw.E.div,{"data-testid":"block-popover-drop-zone",initial:o?BC.show:BC.hide,animate:BC.show,exit:o?BC.show:BC.exit,className:"block-editor-block-popover__drop-zone-foreground"}))};const PC=(0,v.createContext)();function AC(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:r,hideInsertionPoint:o}=(0,S.Z)(ku),i=(0,v.useContext)(PC),l=(0,v.useRef)(),{orientation:a,previousClientId:s,nextClientId:c,rootClientId:u,isInserterShown:d,isDistractionFree:p,isNavigationMode:m}=(0,E.Z)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:r,getBlockInsertionPoint:o,isBlockBeingDragged:i,getPreviousBlockClientId:l,getNextBlockClientId:a,getSettings:s,isNavigationMode:c}=e(ku),u=o(),d=n(u.rootClientId);if(!d.length)return{};let p=d[u.index-1],m=d[u.index];for(;i(p);)p=l(p);for(;i(m);)m=a(m);const f=s();return{previousClientId:p,nextClientId:m,orientation:(null===(t=r(u.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:u.rootClientId,isNavigationMode:c(),isDistractionFree:f.isDistractionFree,isInserterShown:null==u?void 0:u.__unstableWithInserter}}),[]),f=(0,by.Z)(),h={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:d?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},g={start:{scale:f?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(p&&!m)return null;const b=w()("block-editor-block-list__insertion-point","is-"+a);return(0,v.createElement)(IC,{previousClientId:s,nextClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n},(0,v.createElement)(Cw.E.div,{layout:!f,initial:f?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:l,tabIndex:-1,onClick:function(e){e.target===l.current&&c&&r(c,-1)},onFocus:function(e){e.target!==l.current&&(i.current=!0)},className:w()(b,{"is-with-inserter":d}),onHoverEnd:function(e){e.target!==l.current||i.current||o()}},(0,v.createElement)(Cw.E.div,{variants:h,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),d&&(0,v.createElement)(Cw.E.div,{variants:g,className:w()("block-editor-block-list__insertion-point-inserter")},(0,v.createElement)(yC,{position:"bottom center",clientId:c,rootClientId:u,__experimentalIsQuick:!0,onToggle:e=>{i.current=e},onSelectOrClose:()=>{i.current=!1}}))))}function DC(e){const{insertionPoint:t,isVisible:n}=(0,E.Z)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n}=e(ku);return{insertionPoint:t(),isVisible:n()}}),[]);return n?"replace"===t.operation?(0,v.createElement)(LC,(0,Po.Z)({key:`${t.rootClientId}-${t.index}`},e)):(0,v.createElement)(AC,e):null}function RC(){const e=(0,v.useContext)(PC),t=(0,E.Z)((e=>e(ku).getSettings().isDistractionFree||"zoom-out"===e(ku).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockRootClientId:r,getBlockIndex:o,isBlockInsertionPointVisible:i,isMultiSelecting:l,getSelectedBlockClientIds:a,getTemplateLock:s,__unstableIsWithinBlockOverlay:c}=(0,E.Z)(ku),{showInsertionPoint:u,hideInsertionPoint:d}=(0,S.Z)(ku);return(0,bl.Z)((r=>{if(!t)return r.addEventListener("mousemove",i),()=>{r.removeEventListener("mousemove",i)};function i(t){var r;if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(l())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let i;if(t.target.classList.contains("is-root-container")||(i=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(i))return;const p=(null===(r=n(i))||void 0===r?void 0:r.orientation)||"vertical",m=t.clientY,f=t.clientX;let h=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>m||e.classList.contains("wp-block")&&"horizontal"===p&&t.left>f}));if(!h)return void d();if(!h.id&&(h=h.firstElementChild,!h))return void d();const g=h.id.slice("block-".length);if(!g||c(g))return;if(a().includes(g))return;const v=h.getBoundingClientRect();if("horizontal"===p&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,OC="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function ZC(e){return(0,E.Z)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(ku),{getBlockType:o,getActiveBlockVariation:i}=t(Xt),l=n(e),a=o(l);if(!a)return null;const s=r(e),c=i(l,s),u=ge(a)||ve(a),d={isSynced:u,title:a.title,icon:a.icon,description:a.description,anchor:null==s?void 0:s.anchor};return c?{isSynced:u,title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:null==s?void 0:s.anchor}:d}),[e])}function FC(e){let{clientId:t,maximumLength:n,context:r}=e;const{attributes:o,name:i,reusableBlockTitle:l}=(0,E.Z)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:r,__experimentalGetReusableBlockTitle:o}=e(ku),i=n(t);if(!i)return{};const l=ge(pe(i));return{attributes:r(t),name:i,reusableBlockTitle:l&&o(r(t).ref)}}),[t]),a=ZC(t);if(!i||!a)return null;const s=pe(i),c=s?Fe(s,o,r):null,u=l||c,d=u&&u!==s.title?u:a.title;if(n&&n>0&&d.length>n){const e="...";return d.slice(0,n-e.length)+e}return d}function jC(e){let{clientId:t,maximumLength:n,context:r}=e;return FC({clientId:t,maximumLength:n,context:r})}var zC=e=>{let{children:t,clientIds:n,cloneClassname:r,onDragStart:o,onDragEnd:i}=e;const{srcRootClientId:l,isDraggable:a,icon:s}=(0,E.Z)((e=>{var t;const{canMoveBlocks:r,getBlockRootClientId:o,getBlockName:i}=e(ku),l=o(n[0]),a=i(n[0]);return{srcRootClientId:l,isDraggable:r(n,l),icon:null===(t=pe(a))||void 0===t?void 0:t.icon}}),[n]),c=(0,v.useRef)(!1),[u,d,p]=function(){const e=(0,v.useRef)(null),t=(0,v.useRef)(null),n=(0,v.useRef)(null),r=(0,v.useRef)(null);return(0,v.useEffect)((()=>()=>{r.current&&(clearInterval(r.current),r.current=null)}),[]),[(0,v.useCallback)((o=>{e.current=o.clientY,n.current=(0,yy.Z)(o.target),r.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,v.useCallback)((r=>{if(!n.current)return;const o=n.current.offsetHeight,i=e.current-n.current.offsetTop,l=r.clientY-n.current.offsetTop;if(r.clientY>i){const e=Math.max(o-i-50,0),n=Math.max(l-i-50,0)/e;t.current=25*n}else if(r.clientY{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{startDraggingBlocks:m,stopDraggingBlocks:f}=(0,S.Z)(ku);if((0,v.useEffect)((()=>()=>{c.current&&f()}),[]),!a)return t({draggable:!1});const h={type:"block",srcClientIds:n,srcRootClientId:l};return(0,v.createElement)(Qk,{cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:h,onDragStart:e=>{m(n),c.current=!0,u(e),o&&o()},onDragOver:d,onDragEnd:()=>{f(),c.current=!1,p(),i&&i()},__experimentalDragComponent:(0,v.createElement)(tx,{count:n.length,icon:s})},(e=>{let{onDraggableStart:n,onDraggableEnd:r}=e;return t({draggable:!0,onDragStart:n,onDragEnd:r})}))},HC=n(33535),VC=n(96328);const WC=(e,t)=>"up"===e?"horizontal"===t?(0,N.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,N.isRTL)()?"left":"right":"down":null;const $C=(e,t)=>"up"===e?"horizontal"===t?(0,N.isRTL)()?b_.Z:y_.Z:HC.Z:"down"===e?"horizontal"===t?(0,N.isRTL)()?y_.Z:b_.Z:VC.Z:null,UC=(e,t)=>"up"===e?"horizontal"===t?(0,N.isRTL)()?(0,N.__)("Move right"):(0,N.__)("Move left"):(0,N.__)("Move up"):"down"===e?"horizontal"===t?(0,N.isRTL)()?(0,N.__)("Move left"):(0,N.__)("Move right"):(0,N.__)("Move down"):null,GC=(0,v.forwardRef)(((e,t)=>{let{clientIds:n,direction:r,orientation:o,...i}=e;const l=(0,dd.Z)(GC),a=Array.isArray(n)?n:[n],s=a.length,{blockType:c,isDisabled:u,rootClientId:d,isFirst:p,isLast:m,firstIndex:f,orientation:h="vertical"}=(0,E.Z)((e=>{const{getBlockIndex:t,getBlockRootClientId:n,getBlockOrder:i,getBlock:l,getBlockListSettings:s}=e(ku),c=a[0],u=n(c),d=t(c),p=t(a[a.length-1]),m=i(u),f=l(c),h=0===d,g=p===m.length-1,{orientation:v}=s(u)||{};return{blockType:f?pe(f.name):null,isDisabled:"up"===r?h:g,rootClientId:u,firstIndex:d,isFirst:h,isLast:g,orientation:o||v}}),[n,r]),{moveBlocksDown:g,moveBlocksUp:b}=(0,S.Z)(ku),y="up"===r?b:g,_=`block-editor-block-mover-button__description-${l}`;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Mo.ZP,(0,Po.Z)({ref:t,className:w()("block-editor-block-mover-button",`is-${r}-button`),icon:$C(r,h),label:UC(r,h),"aria-describedby":_},i,{onClick:u?null:e=>{y(n,d),i.onClick&&i.onClick(e)},disabled:u,__experimentalIsFocusable:!0})),(0,v.createElement)(n_.Z,{id:_},function(e,t,n,r,o,i,l){const a=n+1;if(e>1)return function(e,t,n,r,o,i){const l=t+1;if(n&&r)return(0,N.__)("All blocks are selected, and cannot be moved");if(o>0&&!r){const t=WC("down",i);if("down"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d down by one place"),e,l);if("left"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o>0&&r){const e=WC("down",i);if("down"===e)return(0,N.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,N.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,N.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(o<0&&!n){const t=WC("up",i);if("up"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d up by one place"),e,l);if("left"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d left by one place"),e,l);if("right"===t)return(0,N.sprintf)((0,N.__)("Move %1$d blocks from position %2$d right by one place"),e,l)}if(o<0&&n){const e=WC("up",i);if("up"===e)return(0,N.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,N.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,N.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,r,o,i,l);if(r&&o)return(0,N.sprintf)((0,N.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!o){const e=WC("down",l);if("down"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&o){const e=WC("down",l);if("down"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!r){const e=WC("up",l);if("up"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,N.sprintf)((0,N.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){const e=WC("up",l);if("up"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,N.sprintf)((0,N.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(s,c&&c.title,f,p,m,"up"===r?-1:1,h)))})),qC=(0,v.forwardRef)(((e,t)=>(0,v.createElement)(GC,(0,Po.Z)({direction:"up",ref:t},e)))),KC=(0,v.forwardRef)(((e,t)=>(0,v.createElement)(GC,(0,Po.Z)({direction:"down",ref:t},e))));var YC=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:r,rootClientId:o,isFirst:i,isLast:l,orientation:a}=(0,E.Z)((e=>{var n;const{getBlockIndex:r,getBlockListSettings:o,canMoveBlocks:i,getBlockOrder:l,getBlockRootClientId:a}=e(ku),s=Array.isArray(t)?t:[t],c=s[0],u=a(c),d=r(c),p=r(s[s.length-1]),m=l(u);return{canMove:i(t,u),rootClientId:u,isFirst:0===d,isLast:p===m.length-1,orientation:null===(n=o(u))||void 0===n?void 0:n.orientation}}),[t]);if(!r||i&&l&&!o)return null;const s=(0,N.__)("Drag");return(0,v.createElement)(Vo,{className:w()("block-editor-block-mover",{"is-horizontal":"horizontal"===a})},!n&&(0,v.createElement)(zC,{clientIds:t},(e=>(0,v.createElement)(Mo.ZP,(0,Po.Z)({icon:ex.Z,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:s,tabIndex:"-1"},e)))),(0,v.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,v.createElement)(Oo.Z,null,(e=>(0,v.createElement)(qC,(0,Po.Z)({clientIds:t},e)))),(0,v.createElement)(Oo.Z,null,(e=>(0,v.createElement)(KC,(0,Po.Z)({clientIds:t},e))))))},XC=function(e){let{clientId:t,rootClientId:n}=e;const r=ZC(t),o=(0,E.Z)((e=>{var r;const{getBlock:o,getBlockIndex:i,hasBlockMovingClientId:l,getBlockListSettings:a,__unstableGetEditorMode:s}=e(ku),c=i(t),{name:u,attributes:d}=o(t);return{index:c,name:u,attributes:d,blockMovingMode:l(),orientation:null===(r=a(n))||void 0===r?void 0:r.orientation,editorMode:s()}}),[t,n]),{index:i,name:l,attributes:a,blockMovingMode:s,orientation:c,editorMode:u}=o,{setNavigationMode:d,removeBlock:p}=(0,S.Z)(ku),m=(0,v.useRef)(),f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const o=null==e?void 0:e.title,i=e?Fe(e,t,"accessibility"):"",l=void 0!==n,a=i&&i!==o;return l&&"vertical"===r?a?(0,N.sprintf)((0,N.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,N.sprintf)((0,N.__)("%1$s Block. Row %2$d"),o,n):l&&"horizontal"===r?a?(0,N.sprintf)((0,N.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,N.sprintf)((0,N.__)("%1$s Block. Column %2$d"),o,n):a?(0,N.sprintf)((0,N.__)("%1$s Block. %2$s"),o,i):(0,N.sprintf)((0,N.__)("%s Block"),o)}(pe(l),a,i+1,c);(0,v.useEffect)((()=>{m.current.focus(),(0,fl.D)(f)}),[f]);const h=Uy(t),{hasBlockMovingClientId:g,getBlockIndex:b,getBlockRootClientId:y,getClientIdsOfDescendants:_,getSelectedBlockClientId:k,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:C,getNextBlockClientId:I}=(0,E.Z)(ku),{selectBlock:T,clearSelectedBlock:B,setBlockMovingClientId:L,moveBlockToPosition:P}=(0,S.Z)(ku),A=w()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!s}),D=(0,N.__)("Drag");return(0,v.createElement)("div",{className:A},(0,v.createElement)(Uu.Z,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,v.createElement)(Gu.Z,null,(0,v.createElement)(k_,{icon:null==r?void 0:r.icon,showColors:!0})),(0,v.createElement)(Gu.Z,null,"zoom-out"===u&&(0,v.createElement)(YC,{clientIds:[t],hideDragHandle:!0}),"navigation"===u&&(0,v.createElement)(zC,{clientIds:[t]},(e=>(0,v.createElement)(Mo.ZP,(0,Po.Z)({icon:ex.Z,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{ref:m,onClick:"navigation"===u?()=>d(!1):void 0,onKeyDown:function(e){const{keyCode:n}=e,r=n===Al.UP,o=n===Al.DOWN,i=n===Al.LEFT,l=n===Al.RIGHT,a=n===Al.TAB,s=n===Al.ESCAPE,c=n===Al.ENTER,u=n===Al.SPACE,d=e.shiftKey;if(n===Al.BACKSPACE||n===Al.DELETE)return p(t),void e.preventDefault();const m=k(),f=x(),v=C(f||m),w=I(f||m),E=a&&d||r,S=a&&!d||o,N=i,A=l;let D;if(E)D=v;else if(S)D=w;else if(N){var R;D=null!==(R=y(m))&&void 0!==R?R:m}else if(A){var M;D=null!==(M=_([m])[0])&&void 0!==M?M:m}const O=g();if(s&&O&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&O){const e=y(O),t=y(m),n=b(O);let r=b(m);n{const t=!wy.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||(0,St.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,v.useLayoutEffect)((()=>{const t=new window.MutationObserver(r);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(l);return function(e,t,n,r,o){const[i]=(0,v.useState)(t),[l]=(0,v.useState)(r),a=(0,v.useCallback)((()=>{!function(e){const[t]=wy.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,K_.bx)("core/block-editor/focus-toolbar",a),(0,v.useEffect)((()=>{i&&a()}),[n,i,a]),(0,v.useEffect)((()=>{let t=0;return l&&!i&&(t=window.requestAnimationFrame((()=>{const t=iE(e.current),n=l||0;var r;t[n]&&(r=e.current).contains(r.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!o||!e.current)return;const n=iE(e.current).findIndex((e=>0===e.tabIndex));o(n)}}),[l,i])}(l,n,a,r,o),a?(0,v.createElement)(rE,(0,Po.Z)({label:i["aria-label"],ref:l},i),t):(0,v.createElement)(oE.Z,(0,Po.Z)({orientation:"horizontal",role:"toolbar",ref:l},i),t)};const{clearTimeout:aE,setTimeout:sE}=window,cE=()=>{},uE=200;function dE(e){let{ref:t,isFocused:n,debounceTimeout:r=uE,onChange:o=cE}=e;const[i,l]=(0,v.useState)(!1),a=(0,v.useRef)(),s=e=>{null!=t&&t.current&&l(e),o(e)},c=()=>{const e=a.current;e&&aE&&aE(e)};return(0,v.useEffect)((()=>()=>{s(!1),c()}),[]),{showMovers:i,debouncedShowMovers:e=>{e&&e.stopPropagation(),c(),i||s(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),c(),a.current=sE((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&s(!1)}),r)}}}function pE(e){let{ref:t,debounceTimeout:n=uE,onChange:r=cE}=e;const[o,i]=(0,v.useState)(!1),{showMovers:l,debouncedShowMovers:a,debouncedHideMovers:s}=dE({ref:t,debounceTimeout:n,isFocused:o,onChange:r}),c=(0,v.useRef)(!1),u=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,v.useEffect)((()=>{const e=t.current,n=()=>{u()&&(i(!0),a())},r=()=>{u()||(i(!1),s())};return e&&!c.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",r,!0),c.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",r))}}),[t,c,i,a,s]),{showMovers:l,gestures:{onMouseMove:a,onMouseLeave:s}}}function mE(){const{selectBlock:e,toggleBlockHighlight:t}=(0,S.Z)(ku),{firstParentClientId:n,shouldHide:r,isDistractionFree:o}=(0,E.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:r,getSettings:o}=e(ku),{hasBlockSupport:i}=e(Xt),l=n(r()),a=l[l.length-1],s=pe(t(a)),c=o();return{firstParentClientId:a,shouldHide:!i(s,"__experimentalParentSelector",!0),isDistractionFree:c.isDistractionFree}}),[]),i=ZC(n),l=(0,v.useRef)(),{gestures:a}=pE({ref:l,onChange(e){e&&o||t(n,e)}});return r||void 0===n?null:(0,v.createElement)("div",(0,Po.Z)({className:"block-editor-block-parent-selector",key:n,ref:l},a),(0,v.createElement)(Fo,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,N.sprintf)((0,N.__)("Select %s"),null==i?void 0:i.title),showTooltip:!0,icon:(0,v.createElement)(k_,{icon:null==i?void 0:i.icon})}))}var fE=n(53318);function hE(e){let{blocks:t}=e;return(0,v.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,v.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,v.createElement)(T.Z,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1},(0,v.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,v.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,N.__)("Preview")),(0,v.createElement)(jk,{viewportWidth:500,blocks:t})))))}function gE(e){let{restTransformations:t,onSelect:n,setHoveredTransformItemName:r}=e;return t.map((e=>(0,v.createElement)(vE,{key:e.name,item:e,onSelect:n,setHoveredTransformItemName:r})))}function vE(e){let{item:t,onSelect:n,setHoveredTransformItemName:r}=e;const{name:o,icon:i,title:l,isDisabled:a}=t;return(0,v.createElement)(Zu.Z,{className:vn(o),onClick:e=>{e.preventDefault(),n(o)},disabled:a,onMouseLeave:()=>r(null),onMouseEnter:()=>r(o)},(0,v.createElement)(k_,{icon:i,showColors:!0}),l)}var bE=e=>{let{className:t,possibleBlockTransformations:n,onSelect:r,blocks:o}=e;const[i,l]=(0,v.useState)(),{priorityTextTransformations:a,restTransformations:s}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,v.useMemo)((()=>{const n=Object.keys(t);return e.reduce(((e,t)=>{const{name:r}=t;return n.includes(r)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]})}),[e]);return n.priorityTextTransformations.sort(((e,n)=>{let{name:r}=e,{name:o}=n;return t[r](0,v.createElement)(vE,{key:e.name,item:e,onSelect:r,setHoveredTransformItemName:l}))),!c&&u),!!c&&(0,v.createElement)(Ou.Z,{className:t},u))},yE=n(60626);class _E{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.value=e,this._currentValue,this._valueAsArray}entries(){return this._valueAsArray.entries(...arguments)}forEach(){return this._valueAsArray.forEach(...arguments)}keys(){return this._valueAsArray.keys(...arguments)}values(){return this._valueAsArray.values(...arguments)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(){for(var e=arguments.length,t=new Array(e),n=0;n!t.includes(e))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}function kE(e,t,n){const r=new _E(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+n.name),r.value}function xE(e){return null==e?void 0:e.find((e=>e.isDefault))}function wE(e){let{clientId:t,onSwitch:n}=e;const{styles:r,block:o,blockType:i,className:l}=(0,E.Z)((e=>{const{getBlock:n}=e(ku),r=n(t);if(!r)return{};const o=pe(r.name),{getBlockStyles:i}=e(Xt);return{block:r,blockType:o,styles:i(r.name),className:r.attributes.className||""}}),[t]),{updateBlockAttributes:a}=(0,S.Z)(ku),s=function(e){return e&&0!==e.length?xE(e)?e:[{name:"default",label:(0,N._x)("Default","block style"),isDefault:!0},...e]:[]}(r),c=function(e,t){for(const n of new _E(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),r=null==e?void 0:e.find((e=>{let{name:n}=e;return n===t}));if(r)return r}return xE(e)}(s,l),u=function(e,t){return(0,v.useMemo)((()=>{const n=null==t?void 0:t.example,r=null==t?void 0:t.name;return n&&r?Ae(r,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?Ce(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(o,i);return{onSelect:e=>{const r=kE(l,c,e);a(t,{className:r}),n()},stylesToRender:s,activeStyle:c,genericPreviewBlock:u,className:l}}const CE=()=>{};function EE(e){let{clientId:t,onSwitch:n=CE}=e;const{onSelect:r,stylesToRender:o,activeStyle:i}=wE({clientId:t,onSwitch:n});return o&&0!==o.length?(0,v.createElement)(v.Fragment,null,o.map((e=>{const t=e.label||e.name;return(0,v.createElement)(Zu.Z,{key:e.name,icon:i.name===e.name?If.Z:null,onClick:()=>r(e)},(0,v.createElement)(yE.Z,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function SE(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:r}=t;return(0,v.createElement)(Ou.Z,{label:(0,N.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,v.createElement)(EE,{clientId:r,onSwitch:n}))}const IE=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:r,name:o,innerBlocks:i=[]}=e;if(!n.has(r)){if(o===t)return e;for(const e of i){const r=IE(e,t,n);if(r)return r}}},TE=(e,t)=>{const n=((e,t)=>{const n=function(e,t){var n;const r=null===(n=pe(e))||void 0===n?void 0:n.attributes;if(!r)return[];return Object.keys(r).filter((e=>{var n;return(null===(n=r[e])||void 0===n?void 0:n.__experimentalRole)===t}))}(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function NE(e){let{patterns:t,onSelect:n}=e;return(0,v.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,v.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,v.createElement)(T.Z,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,v.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,v.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,N.__)("Preview")),(0,v.createElement)(BE,{patterns:t,onSelect:n})))))}function BE(e){let{patterns:t,onSelect:n}=e;const r=(0,ux.u)();return(0,v.createElement)(Dx.b,(0,Po.Z)({},r,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,N.__)("Patterns list")}),t.map((e=>(0,v.createElement)(LE,{key:e.name,pattern:e,onSelect:n,composite:r}))))}function LE(e){let{pattern:t,onSelect:n,composite:r}=e;const o="block-editor-block-switcher__preview-patterns-container",i=(0,dd.Z)(LE,`${o}-list__item-description`);return(0,v.createElement)("div",{className:`${o}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?i:void 0},(0,v.createElement)(qk.A,(0,Po.Z)({role:"option",as:"div"},r,{className:`${o}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,v.createElement)(jk,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,v.createElement)("div",{className:`${o}-list__item-title`},t.title)),!!t.description&&(0,v.createElement)(n_.Z,{id:i},t.description))}var PE=function(e){let{blocks:t,patterns:n,onSelect:r}=e;const[o,i]=(0,v.useState)(!1),l=((e,t)=>(0,v.useMemo)((()=>e.reduce(((e,n)=>{const r=((e,t)=>{const n=t.map((e=>Ce(e))),r=new Set;for(const t of e){let e=!1;for(const o of n){const n=IE(o,t.name,r);if(n){e=!0,r.add(n.clientId),TE(n,t);break}}if(!e)return}return n})(t,n.blocks);return r&&e.push({...n,transformedBlocks:r}),e}),[])),[e,t]))(n,t);return l.length?(0,v.createElement)(Ou.Z,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},o&&(0,v.createElement)(NE,{patterns:l,onSelect:r}),(0,v.createElement)(Zu.Z,{onClick:e=>{e.preventDefault(),i(!o)},icon:b_.Z},(0,N.__)("Patterns"))):null};const AE=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:r,multiSelect:o}=(0,S.Z)(ku),i=ZC(n[0].clientId),{possibleBlockTransformations:l,canRemove:a,hasBlockStyles:s,icon:c,patterns:u}=(0,E.Z)((e=>{const{getBlockRootClientId:r,getBlockTransformItems:o,__experimentalGetPatternTransformItems:l}=e(ku),{getBlockStyles:a,getBlockType:s}=e(Xt),{canRemoveBlocks:c}=e(ku),u=r(Array.isArray(t)?t[0]:t),[{name:d}]=n,p=1===n.length,m=p&&a(d);let f;if(p)f=null==i?void 0:i.icon;else{var h;const e=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size;f=e?null===(h=s(d))||void 0===h?void 0:h.icon:fE.Z}return{possibleBlockTransformations:o(n,u),canRemove:c(t,u),hasBlockStyles:!(null==m||!m.length),icon:f,patterns:l(n,u)}}),[t,n,null==i?void 0:i.icon]),d=FC({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),p=1===n.length&&ge(n[0]),m=1===n.length&&ve(n[0]);function f(e){e.length>1&&o(e[0].clientId,e[e.length-1].clientId)}const h=!!l.length&&a&&!m,g=!(null==u||!u.length)&&a;if(!s&&!h)return(0,v.createElement)(Vo,null,(0,v.createElement)(Fo,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:d,icon:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(k_,{icon:c,showColors:!0}),(p||m)&&(0,v.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},d))}));const b=d,y=1===n.length?(0,N.sprintf)((0,N.__)("%s: Change block type or style"),d):(0,N.sprintf)((0,N._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),_=s||h||g;return(0,v.createElement)(Vo,null,(0,v.createElement)(Oo.Z,null,(e=>(0,v.createElement)(zo.Z,{className:"block-editor-block-switcher",label:b,popoverProps:{position:"bottom right",variant:"toolbar",className:"block-editor-block-switcher__popover"},icon:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(k_,{icon:c,className:"block-editor-block-switcher__toggle",showColors:!0}),(p||m)&&(0,v.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},d)),toggleProps:{describedBy:y,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:o}=e;return _&&(0,v.createElement)("div",{className:"block-editor-block-switcher__container"},g&&(0,v.createElement)(PE,{blocks:n,patterns:u,onSelect:e=>{!function(e){r(t,e),f(e)}(e),o()}}),h&&(0,v.createElement)(bE,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:l,blocks:n,onSelect:e=>{!function(e){const o=Pe(n,e);r(t,o),f(o)}(e),o()}}),s&&(0,v.createElement)(SE,{hoveredBlock:n[0],onSwitch:o}))})))))};var DE=e=>{let{clientIds:t}=e;const n=(0,E.Z)((e=>e(ku).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,v.createElement)(AE,{clientIds:t,blocks:n})};const{Fill:RE,Slot:ME}=(0,I.up)("__unstableBlockToolbarLastItem");RE.Slot=ME;var OE=RE,ZE=n(92022),FE=n.n(ZE);function jE(e){const t=(0,v.useRef)(e);return t.current=e,t}function zE(e,t){const n=jE(e),r=jE(t);return(0,bl.Z)((e=>{const t=new(FE())(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(t=>{let{clearSelection:n}=t;n(),e.focus(),r.current&&r.current()})),()=>{t.destroy()}}),[])}const HE="__experimentalBorder",VE="color",WE="typography.__experimentalFontFamily",$E="typography.fontSize",UE=["typography.lineHeight",$E,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",WE,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",HE,VE,"spacing"],GE={align:e=>he(e,"align"),borderColor:e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==ci.Z.OS)return!1;const n=fe(e,HE);return!(!0!==n&&!("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}(e,"color"),backgroundColor:e=>{const t=fe(e,VE);return t&&!1!==t.background},textColor:e=>{const t=fe(e,VE);return t&&!1!==t.text},gradient:e=>{const t=fe(e,VE);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>he(e,"customClassName",!0),fontFamily:e=>he(e,WE),fontSize:e=>he(e,$E),layout:e=>he(e,"__experimentalLayout"),style:e=>UE.some((t=>he(e,t)))};function qE(e,t){return Object.entries(GE).reduce(((n,r)=>{let[o,i]=r;return i(e.name)&&i(t.name)&&(n[o]=e.attributes[o]),n}),{})}function KE(e,t,n){for(let r=0;r!!e&&he(e.name,"multiple",!0)&&o(e.name,p))),f=o(c(),p),h=a(t,p),g=s(t,p),{removeBlocks:b,replaceBlocks:y,duplicateBlocks:_,insertAfterBlock:k,insertBeforeBlock:x,flashBlock:w,setBlockMovingClientId:C,setNavigationMode:I,selectBlock:T}=(0,S.Z)(ku),B=function(){const{getBlockName:e}=(0,E.Z)(ku),{getBlockType:t}=(0,E.Z)(Xt),{createSuccessNotice:n}=(0,S.Z)(Px.h);return(0,v.useCallback)(((r,o)=>{let i="";if(1===o.length){var l;const n=o[0],a=null===(l=t(e(n)))||void 0===l?void 0:l.title;i="copy"===r?(0,N.sprintf)((0,N.__)('Copied "%s" to clipboard.'),a):(0,N.sprintf)((0,N.__)('Moved "%s" to clipboard.'),a)}else i="copy"===r?(0,N.sprintf)((0,N._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,N.sprintf)((0,N._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}(),L=function(){const e=(0,yl.Z)(),{updateBlockAttributes:t}=(0,S.Z)(ku),{createSuccessNotice:n,createWarningNotice:r,createErrorNotice:o}=(0,S.Z)(Px.h);return(0,v.useCallback)((async i=>{let l="";try{if(!window.navigator.clipboard)return void o((0,N.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});l=await window.navigator.clipboard.readText()}catch(e){return void o((0,N.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!l||!function(e){try{const t=Br(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(l))return void r((0,N.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=Br(l);if(1===a.length?e.batch((()=>{KE(i,i.map((()=>a[0])),t)})):e.batch((()=>{KE(i,a,t)})),1===i.length){var s;const e=null===(s=pe(i[0].name))||void 0===s?void 0:s.title;n((0,N.sprintf)((0,N.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,N.sprintf)((0,N.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,r,o])}();return n({canDuplicate:m,canInsertDefaultBlock:f,canMove:h,canRemove:g,rootClientId:p,blocks:d,onDuplicate:()=>_(t,r),onRemove:()=>b(t,r),onInsertBefore(){const e=Array.isArray(t)?t[0]:e;x(e)},onInsertAfter(){const e=Array.isArray(t)?t[t.length-1]:e;k(e)},onMoveTo(){I(!0),T(t[0]),C(t[0])},onGroup(){if(!d.length)return;const e=u(),n=Pe(d,e);n&&y(t,n)},onUngroup(){if(!d.length)return;const e=d[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=d.map((e=>{let{clientId:t}=e;return t}));1===d.length&&w(e[0]),B("copy",e)},async onPasteStyles(){await L(d)}})}const XE=()=>{};var JE=(0,hh.Z)([(0,mh.Z)(((e,t)=>{let{clientId:n}=t;const{getBlock:r,getBlockMode:o,getSettings:i}=e(ku),l=r(n),a=i().codeEditingEnabled;return{mode:o(n),blockType:l?pe(l.name):null,isCodeEditingEnabled:a}})),(0,fh.Z)(((e,t)=>{let{onToggle:n=XE,clientId:r}=t;return{onToggleMode(){e(ku).toggleBlockMode(r),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:r,small:o=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!he(t,"html",!0)||!i)return null;const l="visual"===n?(0,N.__)("Edit as HTML"):(0,N.__)("Edit visually");return(0,v.createElement)(Zu.Z,{onClick:r},!o&&l)})),QE=(0,hh.Z)((0,mh.Z)(((e,t)=>{let{clientId:n}=t;const r=e(ku).getBlock(n);return{block:r,shouldRender:r&&"core/html"===r.name}})),(0,fh.Z)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(ku).replaceBlocks(n.clientId,no({HTML:xn(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:r}=e;if(!t)return null;const o=(0,N.__)("Convert to Blocks");return(0,v.createElement)(Zu.Z,{onClick:n},!r&&o)}));const{Fill:eS,Slot:tS}=(0,I.up)("__unstableBlockSettingsMenuFirstItem");eS.Slot=tS;var nS=eS;function rS(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}=(0,E.Z)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:r,canInsertBlockType:o,getSelectedBlockClientIds:i}=e(ku),{getGroupingBlockName:l}=e(Xt),a=i(),s=l(),c=o(s,null!=a&&a.length?n(a[0]):void 0),u=r(a),d=1===u.length&&(null===(t=u[0])||void 0===t?void 0:t.name)===s;return{clientIds:a,isGroupable:c&&u.length,isUngroupable:d&&!!u[0].innerBlocks.length,blocksSelection:u,groupingBlockName:s}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:r,groupingBlockName:o}}function oS(e){let{clientIds:t,isGroupable:n,isUngroupable:r,blocksSelection:o,groupingBlockName:i,onClose:l=(()=>{})}=e;const{replaceBlocks:a}=(0,S.Z)(ku);return n||r?(0,v.createElement)(v.Fragment,null,n&&(0,v.createElement)(Zu.Z,{onClick:()=>{(()=>{const e=Pe(o,i);e&&a(t,e)})(),l()}},(0,N._x)("Group","verb")),r&&(0,v.createElement)(Zu.Z,{onClick:()=>{(()=>{const e=o[0].innerBlocks;e.length&&a(t,e)})(),l()}},(0,N._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function iS(e){return(0,E.Z)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:l,getBlockRootClientId:a,getTemplateLock:s}=t(ku),c=a(e),u=n(e),d=r(e,c),p=o(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(l(e)),isContentLocked:"contentOnly"===s(e),isLocked:!u||!d||!p}}),[e])}var lS=n(60869),aS=n(72897),sS=n(29195),cS=n(27157);const uS=["core/block","core/navigation"];function dS(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function pS(e){let{clientId:t,onClose:n}=e;const[r,o]=(0,v.useState)({move:!1,remove:!1}),{canEdit:i,canMove:l,canRemove:a}=iS(t),{allowsEditLocking:s,templateLock:c,hasTemplateLock:u}=(0,E.Z)((e=>{var n,r;const{getBlockName:o,getBlockAttributes:i}=e(ku),l=o(t),a=pe(l);return{allowsEditLocking:uS.includes(l),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(r=a.attributes)||void 0===r||!r.templateLock)}}),[t]),[d,p]=(0,v.useState)(!!c),{updateBlockAttributes:m}=(0,S.Z)(ku),f=ZC(t),h=(0,dd.Z)(pS,"block-editor-block-lock-modal__options-title");(0,v.useEffect)((()=>{o({move:!l,remove:!a,...s?{edit:!i}:{}})}),[i,l,a,s]);const g=Object.values(r).every(Boolean),b=Object.values(r).some(Boolean)&&!g;return(0,v.createElement)(Eh.Z,{title:(0,N.sprintf)((0,N.__)("Lock %s"),f.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:n},(0,v.createElement)("p",null,(0,N.__)("Choose specific attributes to restrict or lock all available options.")),(0,v.createElement)("form",{onSubmit:e=>{e.preventDefault(),m([t],{lock:r,templateLock:d?dS(r):void 0}),n()}},(0,v.createElement)("div",{role:"group","aria-labelledby":h,className:"block-editor-block-lock-modal__options"},(0,v.createElement)(sS.C,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,v.createElement)("span",{id:h},(0,N.__)("Lock all")),checked:g,indeterminate:b,onChange:e=>o({move:e,remove:e,...s?{edit:e}:{}})}),(0,v.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},s&&(0,v.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,v.createElement)(sS.C,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Restrict editing"),checked:!!r.edit,onChange:e=>o((t=>({...t,edit:e})))}),(0,v.createElement)(Od.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.edit?cS.Z:lS.Z})),(0,v.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,v.createElement)(sS.C,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Disable movement"),checked:r.move,onChange:e=>o((t=>({...t,move:e})))}),(0,v.createElement)(Od.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.move?cS.Z:lS.Z})),(0,v.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,v.createElement)(sS.C,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Prevent removal"),checked:r.remove,onChange:e=>o((t=>({...t,remove:e})))}),(0,v.createElement)(Od.Z,{className:"block-editor-block-lock-modal__lock-icon",icon:r.remove?cS.Z:lS.Z}))),u&&(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,N.__)("Apply to all blocks inside"),checked:d,disabled:r.move&&!r.remove,onChange:()=>p(!d)})),(0,v.createElement)(Uu.Z,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{variant:"tertiary",onClick:n},(0,N.__)("Cancel"))),(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{variant:"primary",type:"submit"},(0,N.__)("Apply"))))))}function mS(e){let{clientId:t}=e;const{canLock:n,isLocked:r}=iS(t),[o,i]=(0,v.useReducer)((e=>!e),!1);if(!n)return null;const l=r?(0,N.__)("Unlock"):(0,N.__)("Lock");return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Zu.Z,{icon:r?lS.Z:aS.Z,onClick:i},l),o&&(0,v.createElement)(pS,{clientId:t,onClose:i}))}const{Fill:fS,Slot:hS}=(0,I.up)("BlockSettingsMenuControls");function gS(e){let{...t}=e;return(0,v.createElement)(Do.Z,{document:document},(0,v.createElement)(fS,t))}gS.Slot=e=>{let{fillProps:t,clientIds:n=null,__unstableDisplayLocation:r}=e;const{selectedBlocks:o,selectedClientIds:i,canRemove:l}=(0,E.Z)((e=>{const{getBlockNamesByClientId:t,getSelectedBlockClientIds:r,canRemoveBlocks:o}=e(ku),i=null!==n?n:r();return{selectedBlocks:t(i),selectedClientIds:i,canRemove:o(i)}}),[n]),{canLock:a}=iS(i[0]),s=1===i.length&&a,c=rS(),{isGroupable:u,isUngroupable:d}=c,p=(u||d)&&l;return(0,v.createElement)(hS,{fillProps:{...t,__unstableDisplayLocation:r,selectedBlocks:o,selectedClientIds:i}},(e=>!(null!=e&&e.length)>0&&!p&&!s?null:(0,v.createElement)(Ou.Z,null,s&&(0,v.createElement)(mS,{clientId:i[0]}),e,p&&(0,v.createElement)(oS,(0,Po.Z)({},c,{onClose:null==t?void 0:t.onClose})))))};var vS=gS;const bS=()=>{},yS={className:"block-editor-block-settings-menu__popover",position:"bottom right",variant:"toolbar"};function _S(e){let{blocks:t,onCopy:n,label:r}=e;const o=zE((()=>Cn(t)),n),i=t.length>1?(0,N.__)("Copy blocks"):(0,N.__)("Copy block"),l=r||i;return(0,v.createElement)(Zu.Z,{ref:o},l)}var kS=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:r,__unstableDisplayLocation:o,...i}=e;const l=Array.isArray(t)?t:[t],a=l.length,s=l[0],{firstParentClientId:c,isDistractionFree:u,onlyBlock:d,parentBlockType:p,previousBlockClientId:m,nextBlockClientId:f,selectedBlockClientIds:h}=(0,E.Z)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:r,getPreviousBlockClientId:o,getNextBlockClientId:i,getSelectedBlockClientIds:l,getSettings:a,getBlockAttributes:c}=e(ku),{getActiveBlockVariation:u}=e(Xt),d=r(s),p=d&&n(d);return{firstParentClientId:d,isDistractionFree:a().isDistractionFree,onlyBlock:1===t(d),parentBlockType:d&&(u(p,c(d))||pe(p)),previousBlockClientId:o(s),nextBlockClientId:i(s),selectedBlockClientIds:l()}}),[s]),g=(0,E.Z)((e=>{const{getShortcutRepresentation:t}=e(K_.h);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:b,toggleBlockHighlight:y}=(0,S.Z)(ku),_=(0,v.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:bS,[n]),k=FC({clientId:s,maximumLength:25}),x=(0,v.useCallback)(n?()=>{const e=m||f||c;e&&h.includes(s)&&!h.includes(e)&&n(e)}:bS,[n,m,f,c,h]),w=(0,N.sprintf)((0,N.__)("Remove %s"),k),C=1===a?w:(0,N.__)("Remove blocks"),I=(0,v.useRef)(),{gestures:T}=pE({ref:I,onChange(e){e&&u||y(c,e)}}),B=null==h?void 0:h.includes(c);return(0,v.createElement)(YE,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:u,canRemove:m,onDuplicate:f,onInsertAfter:h,onInsertBefore:y,onRemove:k,onCopy:w,onPasteStyles:E,onMoveTo:S,blocks:L}=e;return(0,v.createElement)(zo.Z,(0,Po.Z)({icon:Nf.Z,label:(0,N.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:yS,noIcons:!0},i),(e=>{let{onClose:i}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ou.Z,null,(0,v.createElement)(nS.Slot,{fillProps:{onClose:i}}),!B&&!!c&&(0,v.createElement)(Zu.Z,(0,Po.Z)({},T,{ref:I,icon:(0,v.createElement)(k_,{icon:p.icon}),onClick:()=>b(c)}),(0,N.sprintf)((0,N.__)("Select parent block (%s)"),p.title)),1===a&&(0,v.createElement)(QE,{clientId:s}),(0,v.createElement)(_S,{blocks:L,onCopy:w}),n&&(0,v.createElement)(Zu.Z,{onClick:(0,et.Z)(i,f,_),shortcut:g.duplicate},(0,N.__)("Duplicate")),l&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Zu.Z,{onClick:(0,et.Z)(i,y),shortcut:g.insertBefore},(0,N.__)("Insert before")),(0,v.createElement)(Zu.Z,{onClick:(0,et.Z)(i,h),shortcut:g.insertAfter},(0,N.__)("Insert after"))),u&&!d&&(0,v.createElement)(Zu.Z,{onClick:(0,et.Z)(i,S)},(0,N.__)("Move to")),1===a&&(0,v.createElement)(JE,{clientId:s,onToggle:i})),(0,v.createElement)(Ou.Z,null,(0,v.createElement)(_S,{blocks:L,onCopy:w,label:(0,N.__)("Copy styles")}),(0,v.createElement)(Zu.Z,{onClick:E},(0,N.__)("Paste styles"))),(0,v.createElement)(vS.Slot,{fillProps:{onClose:i},clientIds:t,__unstableDisplayLocation:o}),"function"==typeof r?r({onClose:i}):v.Children.map((e=>(0,v.cloneElement)(e,{onClose:i}))),m&&(0,v.createElement)(Ou.Z,null,(0,v.createElement)(Zu.Z,{onClick:(0,et.Z)(i,k,x),shortcut:g.remove},C)))}))}))},xS=function(e){let{clientIds:t,...n}=e;return(0,v.createElement)(Vo,null,(0,v.createElement)(Oo.Z,null,(e=>(0,v.createElement)(kS,(0,Po.Z)({clientIds:t,toggleProps:e},n)))))};function wS(e){let{clientId:t}=e;const n=ZC(t),{canEdit:r,canMove:o,canRemove:i,canLock:l}=iS(t),[a,s]=(0,v.useReducer)((e=>!e),!1);return l?r&&o&&i?null:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Vo,{className:"block-editor-block-lock-toolbar"},(0,v.createElement)(Fo,{icon:cS.Z,label:(0,N.sprintf)((0,N.__)("Unlock %s"),n.title),onClick:s})),a&&(0,v.createElement)(pS,{clientId:t,onClose:s})):null}var CS=n(1358),ES=n(95061),SS=n(75262);const IS={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var TS=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:r}=rS(),{replaceBlocks:o}=(0,S.Z)(ku),{canRemove:i,variations:l}=(0,E.Z)((e=>{const{canRemoveBlocks:r}=e(ku),{getBlockVariations:o}=e(Xt);return{canRemove:r(t),variations:o(n,"transform")}}),[t,n]),a=r=>{const i=Pe(e,n);"string"!=typeof r&&(r="group"),i&&i.length>0&&(i[0].attributes.layout=IS[r],o(t,i))};if(!r||!i)return null;const s=!!l.find((e=>{let{name:t}=e;return"group-row"===t})),c=!!l.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,v.createElement)(Vo,null,(0,v.createElement)(Fo,{icon:CS.Z,label:(0,N._x)("Group","verb"),onClick:a}),s&&(0,v.createElement)(Fo,{icon:ES.Z,label:(0,N._x)("Row","single horizontal line"),onClick:()=>a("row")}),c&&(0,v.createElement)(Fo,{icon:SS.Z,label:(0,N._x)("Stack","verb"),onClick:()=>a("stack")}))};function NS(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,r=(0,E.Z)((e=>!!n&&"html"===e(ku).getBlockMode(n)),[n]),{toggleBlockMode:o}=(0,S.Z)(ku);return r?(0,v.createElement)(Vo,null,(0,v.createElement)(Fo,{onClick:()=>{o(n)}},(0,N.__)("Edit visually"))):null}var BS=(0,v.createContext)(""),LS=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:r,blockType:o,hasFixedToolbar:i,isDistractionFree:l,isValid:a,isVisual:s,isContentLocked:c}=(0,E.Z)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:r,isBlockValid:o,getBlockRootClientId:i,getSettings:l,__unstableGetContentLockingParent:a}=e(ku),s=r(),c=s[0],u=i(c),d=l();return{blockClientIds:s,blockClientId:c,blockType:c&&pe(t(c)),hasFixedToolbar:d.hasFixedToolbar,isDistractionFree:d.isDistractionFree,rootClientId:u,isValid:s.every((e=>o(e))),isVisual:s.every((e=>"visual"===n(e))),isContentLocked:!!a(c)}}),[]),{toggleBlockHighlight:u}=(0,S.Z)(ku),d=(0,v.useRef)(),{showMovers:p,gestures:m}=pE({ref:d,onChange(e){e&&l||u(r,e)}}),f=(0,ch.Z)("medium","<")||i;if(o&&!he(o,"__experimentalToolbar",!0))return null;const h=f||p;if(0===n.length)return null;const g=a&&s,b=n.length>1,y=ge(o)||ve(o),_=w()("block-editor-block-toolbar",{"is-showing-movers":h,"is-synced":y});return(0,v.createElement)("div",{className:_},!b&&!f&&!c&&(0,v.createElement)(mE,null),(0,v.createElement)("div",(0,Po.Z)({ref:d},m),(g||b)&&!c&&(0,v.createElement)(Vo,{className:"block-editor-block-toolbar__block-controls"},(0,v.createElement)(DE,{clientIds:n}),!b&&(0,v.createElement)(wS,{clientId:n[0]}),(0,v.createElement)(YC,{clientIds:n,hideDragHandle:t}))),g&&b&&(0,v.createElement)(TS,null),g&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,v.createElement)(Ru.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,v.createElement)(Ru.Slot,{className:"block-editor-block-toolbar__slot"}),(0,v.createElement)(Ru.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,v.createElement)(Ru.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,v.createElement)(BS.Provider,{value:null==o?void 0:o.name},(0,v.createElement)(OE.Slot,null))),(0,v.createElement)(NS,{clientIds:n}),!c&&(0,v.createElement)(xS,{clientIds:n}))},PS=function(e){let{focusOnMount:t,isFixed:n,...r}=e;const{blockType:o,hasParents:i,showParentSelector:l}=(0,E.Z)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:r,__unstableGetContentLockingParent:o}=e(ku),{getBlockType:i}=e(Xt),l=r(),a=l[0],s=n(a),c=i(t(s[s.length-1]));return{blockType:a&&i(t(a)),hasParents:s.length,showParentSelector:c&&he(c,"__experimentalParentSelector",!0)&&l.length<=1&&!o(a)}}),[]);if(o&&!he(o,"__experimentalToolbar",!0))return null;const a=w()("block-editor-block-contextual-toolbar",{"has-parent":i&&l,"is-fixed":n});return(0,v.createElement)(lE,(0,Po.Z)({focusOnMount:t,className:a,"aria-label":(0,N.__)("Block tools")},r),(0,v.createElement)(LS,{hideDragHandle:n}))},AS=n(12066),DS=n(9701),RS=n(34992),MS=n(51377);const OS=e=>e.__nextUnconstrainedWidth?"":(0,Qu.iv)(qp.W2,"{min-width:130px;}",""),ZS=(0,Ju.Z)(MS.Z,{target:"eswuck60"})(OS,";"),FS=e=>null==e?void 0:e.name,jS=(e,t)=>{let{selectedItem:n}=e,{type:r,changes:o,props:{items:i}}=t;switch(r){case AS.L7.stateChangeTypes.ToggleButtonKeyDownArrowDown:return{selectedItem:i[n?Math.min(i.indexOf(n)+1,i.length-1):0]};case AS.L7.stateChangeTypes.ToggleButtonKeyDownArrowUp:return{selectedItem:i[n?Math.max(i.indexOf(n)-1,0):i.length-1]};default:return o}};function zS(e){var t;const{__next36pxDefaultSize:n=!1,__nextUnconstrainedWidth:r=!1,className:o,hideLabelFromVision:i,label:l,describedBy:a,options:s,onChange:c,size:u="default",value:d,onMouseOver:p,onMouseOut:m,onFocus:f,onBlur:h,__experimentalShowSelectedHint:g=!1}=e,{getLabelProps:b,getToggleButtonProps:y,getMenuProps:_,getItemProps:k,isOpen:x,highlightedIndex:C,selectedItem:E}=(0,AS.L7)({initialSelectedItem:s[0],items:s,itemToString:FS,onSelectedItemChange:c,...null!=d?{selectedItem:d}:void 0,stateReducer:jS}),[S,I]=(0,v.useState)(!1);r||(0,St.default)("Constrained width styles for wp.components.CustomSelectControl",{since:"6.1",version:"6.4",hint:"Set the `__nextUnconstrainedWidth` prop to true to start opting into the new styles, which will become the default in a future version"});const T=_({className:"components-custom-select-control__menu","aria-hidden":!x}),B=(0,v.useCallback)((e=>{var t;e.stopPropagation(),null==T||null===(t=T.onKeyDown)||void 0===t||t.call(T,e)}),[T]);return null!==(t=T["aria-activedescendant"])&&void 0!==t&&t.startsWith("downshift-null")&&delete T["aria-activedescendant"],(0,v.createElement)("div",{className:w()("components-custom-select-control",o)},i?(0,v.createElement)(n_.Z,(0,Po.Z)({as:"label"},b()),l):(0,v.createElement)(Pf.ar,b({className:"components-custom-select-control__label"}),l),(0,v.createElement)(ZS,{__next36pxDefaultSize:n,__nextUnconstrainedWidth:r,isFocused:x||S,__unstableInputWidth:r?void 0:"auto",labelPosition:r?void 0:"top",size:u,suffix:(0,v.createElement)(RS.Z,null)},(0,v.createElement)(DS.Ph,(0,Po.Z)({onMouseOver:p,onMouseOut:m,as:"button",onFocus:function(e){I(!0),null==f||f(e)},onBlur:function(e){I(!1),null==h||h(e)},selectSize:u,__next36pxDefaultSize:n},y({"aria-label":l,"aria-labelledby":void 0,className:"components-custom-select-control__button",describedBy:a||(E?(0,N.sprintf)((0,N.__)("Currently selected: %s"),E.name):(0,N.__)("No selection"))})),FS(E),g&&E.__experimentalHint&&(0,v.createElement)("span",{className:"components-custom-select-control__hint"},E.__experimentalHint))),(0,v.createElement)("ul",(0,Po.Z)({},T,{onKeyDown:B}),x&&s.map(((e,t)=>(0,v.createElement)("li",k({item:e,index:t,key:e.key,className:w()(e.className,"components-custom-select-control__item",{"is-highlighted":t===C,"has-hint":!!e.__experimentalHint,"is-next-36px-default-size":n}),style:e.style}),e.name,e.__experimentalHint&&(0,v.createElement)("span",{className:"components-custom-select-control__item-hint"},e.__experimentalHint),e===E&&(0,v.createElement)(om.Z,{icon:If.Z,className:"components-custom-select-control__item-icon"}))))))}function HS(e){return(0,v.createElement)(zS,(0,Po.Z)({},e,{__experimentalShowSelectedHint:!1}))}var VS=n(65990);const{lock:WS,unlock:$S}=(0,qt.es)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/components"),US={};WS(US,{CustomSelectControl:zS,__experimentalPopoverLegacyPositionToPlacement:VS.KF});const{CustomSelectControl:GS}=yu(US),qS="position",KS="block-editor-hooks__position-selection__select-control__option",YS={key:"default",value:"",name:(0,N.__)("Default"),className:KS},XS={key:"sticky",value:"sticky",name:(0,N.__)("Sticky"),className:KS,__experimentalHint:(0,N.__)("The block will stick to the top of the window instead of scrolling.")},JS={key:"fixed",value:"fixed",name:(0,N.__)("Fixed"),className:KS,__experimentalHint:(0,N.__)("The block will not move when the page is scrolled.")},QS=["top","right","bottom","left"],eI=["sticky","fixed"];function tI(e){return!!fe(e,qS)}function nI(e){var t,n;const r=null===(t=e.style)||void 0===t||null===(n=t.position)||void 0===n?void 0:n.type;return"sticky"===r||"fixed"===r}function rI(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=bp("position.fixed"),n=bp("position.sticky"),r=!t&&!n;return!tI(e)||r}function oI(e){var t;const{attributes:{style:n={}},clientId:r,name:o,setAttributes:i}=e,l=function(e){const t=fe(e,qS);return!!(!0===t||null!=t&&t.fixed)}(o),a=function(e){const t=fe(e,qS);return!!(!0===t||null!=t&&t.sticky)}(o),s=null==n||null===(t=n.position)||void 0===t?void 0:t.type,{hasParents:c}=(0,E.Z)((e=>{const{getBlockParents:t}=e(ku);return{hasParents:t(r).length}}),[r]),u=(0,v.useMemo)((()=>{const e=[YS];return(a&&!c||s===XS.value)&&e.push(XS),(l||s===JS.value)&&e.push(JS),e}),[l,a,c,s]),d=s&&u.find((e=>e.value===s))||YS;return ci.Z.select({web:u.length>1?(0,v.createElement)(nh,{group:"position"},(0,v.createElement)(Xu.ZP,{className:"block-editor-hooks__position-selection"},(0,v.createElement)(GS,{__nextUnconstrainedWidth:!0,__next36pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,N.__)("Position"),hideLabelFromVision:!0,describedBy:(0,N.sprintf)((0,N.__)("Currently selected position: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;(e=>{const t={...n,position:{...null==n?void 0:n.position,type:e,top:"sticky"===e||"fixed"===e?"0px":void 0}};i({style:yp(t)})})(t.value)},size:"__unstable-large"}))):null,native:null})}const iI=(0,Ao.o)((e=>t=>{const{name:n}=t;return[he(n,qS)&&!rI(t)&&(0,v.createElement)(oI,(0,Po.Z)({key:"position"},t)),(0,v.createElement)(e,(0,Po.Z)({key:"edit"},t))]}),"withInspectorControls"),lI=(0,Ao.o)((e=>t=>{var n,r,o,i;const{name:l,attributes:a}=t,s=he(l,qS)&&!rI(t),c=(0,dd.Z)(e),u=(0,v.useContext)(WI.__unstableElementContext);let d;s&&(d=function(e){let{selector:t,style:n}=e,r="";const{type:o}=(null==n?void 0:n.position)||{};return eI.includes(o)?(r+=`${t} {`,r+=`position: ${o};`,QS.forEach((e=>{var t;void 0!==(null==n||null===(t=n.position)||void 0===t?void 0:t[e])&&(r+=`${e}: ${n.position[e]};`)})),"sticky"!==o&&"fixed"!==o||(r+="z-index: 10"),r+="}",r):r}({selector:`.wp-container-${c}.wp-container-${c}`,style:null==a?void 0:a.style})||"");const p=w()(null==t?void 0:t.className,{[`wp-container-${c}`]:s&&!!d,[`is-position-${null==a||null===(n=a.style)||void 0===n||null===(r=n.position)||void 0===r?void 0:r.type}`]:s&&!!d&&!(null==a||null===(o=a.style)||void 0===o||null===(i=o.position)||void 0===i||!i.type)});return(0,v.createElement)(v.Fragment,null,s&&u&&!!d&&(0,b.createPortal)((0,v.createElement)("style",null,d),u),(0,v.createElement)(e,(0,Po.Z)({},t,{className:p})))}));(0,_e.KJ)("editor.BlockListBlock","core/editor/position/with-position-styles",lI),(0,_e.KJ)("editor.BlockEdit","core/editor/position/with-inspector-controls",iI);const aI={placement:"top-start"},sI={...aI,flip:!1,shift:!0},cI={...aI,flip:!0,shift:!1};function uI(e,t,n,r,o){if(!e||!t)return sI;const i=(null==n?void 0:n.scrollTop)||0,l=t.getBoundingClientRect(),a=i+e.getBoundingClientRect().top,s=e.ownerDocument.documentElement.clientHeight,c=a+r,u=l.top>c,d=l.height>s-r;return o||!u&&!d?cI:sI}function dI(e){const{__unstableGetEditorMode:t,isMultiSelecting:n,hasMultiSelection:r,isTyping:o,isBlockInterfaceHidden:i,getSettings:l,getLastMultiSelectedBlockClientId:a}=yu(e(ku));return{editorMode:t(),hasMultiSelection:r(),isMultiSelecting:n(),isTyping:o(),isBlockInterfaceHidden:i(),hasFixedToolbar:l().hasFixedToolbar,isDistractionFree:l().isDistractionFree,lastClientId:r()?a():null}}function pI(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:r,showContents:o,capturingClientId:i,__unstablePopoverSlot:l,__unstableContentRef:a}=e;const{editorMode:s,hasMultiSelection:c,isMultiSelecting:u,isTyping:d,isBlockInterfaceHidden:p,hasFixedToolbar:m,isDistractionFree:f,lastClientId:h}=(0,E.Z)(dI,[]),g=(0,E.Z)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:r,getBlockOrder:o}=e(ku);if(!n())return!1;const i=r();return o(i.rootClientId)[i.index]===t}),[t]),b=(0,ch.Z)("medium"),y=(0,v.useRef)(!1),{stopTyping:_}=(0,S.Z)(ku),k=!d&&"edit"===s&&r,x=!c&&("navigation"===s||"zoom-out"===s),C="edit"===s&&!m&&b&&!u&&!k&&!d&&!p,I=!("edit"!==s||C||m||f||r);(0,K_.bx)("core/block-editor/focus-toolbar",(()=>{y.current=!0,_(!0)}),{isDisabled:!I}),(0,v.useEffect)((()=>{y.current=!1}));const T=(0,v.useRef)(),N=function(e){let{contentElement:t,clientId:n}=e;const r=Uy(n),[o,i]=(0,v.useState)(0),{blockIndex:l,isSticky:a}=(0,E.Z)((e=>{const{getBlockIndex:t,getBlockAttributes:r}=e(ku);return{blockIndex:t(n),isSticky:nI(r(n))}}),[n]),s=(0,v.useMemo)((()=>{if(t)return(0,yy.Z)(t)}),[t]),[c,u]=(0,v.useState)((()=>uI(t,r,s,o,a))),d=(0,bl.Z)((e=>{i(e.offsetHeight)}),[]),p=(0,v.useCallback)((()=>u(uI(t,r,s,o,a))),[t,r,s,o]);return(0,v.useLayoutEffect)(p,[l,p]),(0,v.useLayoutEffect)((()=>{var e,n,o;if(!t||!r)return;const i=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let l;null==i||null===(n=i.addEventHandler)||void 0===n||n.call(i,"resize",p);const a=null==r||null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView;return a.ResizeObserver&&(l=new a.ResizeObserver(p),l.observe(r)),()=>{var e;null==i||null===(e=i.removeEventHandler)||void 0===e||e.call(i,"resize",p),l&&l.disconnect()}}),[p,t,r]),{...c,ref:d}}({contentElement:null==a?void 0:a.current,clientId:t});return k?(0,v.createElement)(NC,(0,Po.Z)({clientId:i||t,__unstableCoverTarget:!0,bottomClientId:h,className:w()("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":g}),__unstablePopoverSlot:l,__unstableContentRef:a,resize:!1,shift:!1},N),(0,v.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,v.createElement)(yC,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0}))):x||C?(0,v.createElement)(NC,(0,Po.Z)({clientId:i||t,bottomClientId:h,className:w()("block-editor-block-list__block-popover",{"is-insertion-point-visible":g}),__unstablePopoverSlot:l,__unstableContentRef:a,resize:!1},N),C&&o&&(0,v.createElement)(PS,{focusOnMount:y.current,__experimentalInitialIndex:T.current,__experimentalOnIndexChange:e=>{T.current=e},key:t}),x&&(0,v.createElement)(XC,{clientId:t,rootClientId:n})):null}function mI(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:r,getBlock:o,getBlockParents:i,getSettings:l,isNavigationMode:a,__experimentalGetBlockListSettingsForBlocks:s}=e(ku),c=t()||n();if(!c)return;const{name:u,attributes:d={}}=o(c)||{},p=i(c),m=s(p),f=p.find((e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars})),h=l();return{clientId:c,rootClientId:r(c),name:u,isDistractionFree:h.isDistractionFree,isNavigationMode:a(),isEmptyDefaultBlock:u&&Me({name:u,attributes:d}),capturingClientId:f}}function fI(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const r=(0,E.Z)(mI,[]);if(!r)return null;const{clientId:o,rootClientId:i,name:l,isEmptyDefaultBlock:a,capturingClientId:s,isDistractionFree:c,isNavigationMode:u}=r;return l?(0,v.createElement)(pI,{clientId:o,rootClientId:i,isEmptyDefaultBlock:a,showContents:!c||u,capturingClientId:s,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function hI(e){let{children:t}=e;const n=(0,v.useContext)(PC),r=(0,v.useContext)(M_.Context);return n||r?t:((0,St.default)('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8",version:"6.3"}),(0,v.createElement)(DC,{__unstablePopoverSlot:"block-toolbar"},(0,v.createElement)(fI,{__unstablePopoverSlot:"block-toolbar"}),t))}var gI=(0,Ao.o)((e=>t=>{const{clientId:n}=Su();return(0,v.createElement)(e,(0,Po.Z)({},t,{clientId:n}))}),"withClientId"),vI=gI((e=>{let{clientId:t,showSeparator:n,isFloating:r,onAddBlock:o,isToggle:i}=e;return(0,v.createElement)(xC,{className:w()({"block-list-appender__toggle":i}),rootClientId:t,showSeparator:n,isFloating:r,onAddBlock:o})})),bI=(0,hh.Z)([gI,(0,mh.Z)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:r}=e(ku),o=r(n);return{lastBlockClientId:o[o.length-1]}}))])((e=>{let{clientId:t}=e;return(0,v.createElement)(_C,{rootClientId:t})}));const yI=new WeakMap;var _I=n(66344);function kI(e,t,n){const r=(0,_I.Pr)((()=>Xk(e,null!=t?t:0,n)),[e,t,n]);return(0,v.useEffect)((()=>()=>r.cancel()),[r]),r}function xI(e){const t=(0,v.useRef)();return t.current=e,t}function wI(e){let{isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:l,onDragOver:a}=e;const s=xI(n),c=xI(r),u=xI(o),d=xI(i),p=xI(l),m=xI(a);return(0,bl.Z)((e=>{if(t)return;let n=!1;const{ownerDocument:r}=e;function o(e){n||(n=!0,r.addEventListener("dragend",h),r.addEventListener("mousemove",h),c.current&&c.current(e))}function i(t){t.preventDefault(),e.contains(t.relatedTarget)||u.current&&u.current(t)}function l(e){!e.defaultPrevented&&m.current&&m.current(e),e.preventDefault()}function a(t){(function(t){const{defaultView:n}=r;if(!(t&&n&&t instanceof n.HTMLElement&&e.contains(t)))return!1;let o=t;do{if(o.dataset.isDropZone)return o===e}while(o=o.parentElement);return!1})(t.relatedTarget)||d.current&&d.current(t)}function f(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,s.current&&s.current(e),h(e))}function h(e){n&&(n=!1,r.removeEventListener("dragend",h),r.removeEventListener("mousemove",h),p.current&&p.current(e))}return e.dataset.isDropZone="true",e.addEventListener("drop",f),e.addEventListener("dragenter",i),e.addEventListener("dragover",l),e.addEventListener("dragleave",a),r.addEventListener("dragenter",o),()=>{delete e.dataset.isDropZone,e.removeEventListener("drop",f),e.removeEventListener("dragenter",i),e.removeEventListener("dragover",l),e.removeEventListener("dragleave",a),r.removeEventListener("dragend",h),r.removeEventListener("mousemove",h),r.removeEventListener("dragenter",o)}}),[t])}var CI=n(69793);function EI(e,t,n,r,o,i,l){return a=>{const{srcRootClientId:s,srcClientIds:c,type:u,blocks:d}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===u){l();const e=d.map((e=>Ce(e)));i(e,!0,null)}if("block"===u){const i=n(c[0]);if(s===e&&i===t)return;if(c.includes(e)||r(c).some((t=>t===e)))return;const l=s===e,a=c.length;o(c,s,l&&i{if(!n)return;const l=Ne(Be("from"),(n=>"files"===n.type&&o(n.blockName,e)&&n.isMatch(t)));if(l){const e=l.transform(t,r);i(e)}}}function II(e,t,n){return e=>{const t=No({HTML:e,mode:"BLOCKS"});t.length&&n(t)}}function TI(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{operation:r="insert"}=n,o=(0,E.Z)((e=>e(ku).getSettings().mediaUpload),[]),{canInsertBlockType:i,getBlockIndex:l,getClientIdsOfDescendants:a,getBlockOrder:s,getBlocksByClientId:c}=(0,E.Z)(ku),{insertBlocks:u,moveBlocksToPosition:d,updateBlockAttributes:p,clearSelectedBlock:m,replaceBlocks:f,removeBlocks:h}=(0,S.Z)(ku),g=(0,yl.Z)(),b=(0,v.useCallback)((function(n){let o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("replace"===r){const r=s(e)[t];f(r,n,void 0,i)}else u(n,t,e,o,i)}),[r,s,u,f,t,e]),y=(0,v.useCallback)(((n,o,i)=>{if("replace"===r){const r=c(n),o=s(e)[t];g.batch((()=>{h(n,!1),f(o,r,void 0,0)}))}else d(n,o,e,i)}),[r,s,c,u,d,h,t,e]),_=EI(e,t,l,a,y,b,m),k=SI(e,0,o,p,i,b),x=II(0,0,b);return e=>{const t=(0,CI.f)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?x(n):t.length?k(t):_(e)}}function NI(e,t,n){const r="top"===n||"bottom"===n,{x:o,y:i}=e,l=r?o:i,a=r?i:o,s=r?t.left:t.top,c=r?t.right:t.bottom,u=t[n];let d;return d=l>=s&&l<=c?l:l2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return o.forEach((o=>{const i=NI(e,t,o);(void 0===n||i=e.x&&t.top<=e.y&&t.bottom>=e.y}function PI(e,t){var n,r;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const i="horizontal"===o?["left","right"]:["top","bottom"],l=(0,N.isRTL)();let a=0,s="before",c=1/0;e.forEach((e=>{let{isUnmodifiedDefaultBlock:n,getBoundingClientRect:r,blockIndex:o}=e;const u=r();let[d,p]=BI(t,u,i);n&&LI(t,u)&&(d=0),d0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,v.useState)({index:null,operation:"insert"}),r=(0,E.Z)((t=>{const{getTemplateLock:n,__unstableIsWithinBlockOverlay:r,__unstableHasActiveBlockOverlayActive:o}=t(ku),i=n(e);return["all","contentOnly"].some((e=>e===i))||o(e)||r(e)}),[e]),{getBlockListSettings:o,getBlocks:i,getBlockIndex:l}=(0,E.Z)(ku),{showInsertionPoint:a,hideInsertionPoint:s}=(0,S.Z)(ku),c=TI(e,t.index,{operation:t.operation}),u=kI((0,v.useCallback)(((t,r)=>{var s;const c=i(e);if(0===c.length)return void n({index:0,operation:"insert"});const u=c.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:Me(e),getBoundingClientRect:()=>r.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:l(t)}})),[d,p]=PI(u,{x:t.clientX,y:t.clientY},null===(s=o(e))||void 0===s?void 0:s.orientation);n({index:d,operation:p}),a(e,d,{operation:p})}),[e]),200);return wI({isDisabled:r,onDrop:c,onDragOver(e){u(e,e.currentTarget.ownerDocument)},onDragLeave(){u.cancel(),s()},onDragEnd(){u.cancel(),s()}})}const DI={};function RI(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:r,__experimentalDirectInsert:o,template:i,templateLock:l,wrapperRef:a,templateInsertUpdatesSelection:s,__experimentalCaptureToolbars:c,__experimentalAppenderTagName:u,renderAppender:d,orientation:p,placeholder:m,layout:f}=e;!function(e,t,n,r,o,i,l,a){const{updateBlockListSettings:s}=(0,S.Z)(ku),c=(0,yl.Z)(),{blockListSettings:u,parentLock:d}=(0,E.Z)((t=>{const n=t(ku).getBlockRootClientId(e);return{blockListSettings:t(ku).getBlockListSettings(e),parentLock:t(ku).getTemplateLock(n)}}),[e]),p=(0,v.useMemo)((()=>t),t);(0,v.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===o||"contentOnly"===d?d:o};if(void 0!==i&&(t.__experimentalCaptureToolbars=i),void 0!==l)t.orientation=l;else{const e=jm(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==r&&(t.__experimentalDirectInsert=r),(0,fn.ZP)(u,t)||(yI.get(c)||yI.set(c,[]),yI.get(c).push([e,t]),window.queueMicrotask((()=>{var e;null!==(e=yI.get(c))&&void 0!==e&&e.length&&c.batch((()=>{yI.get(c).forEach((e=>{s(...e)})),yI.set(c,[])}))})))}),[e,u,p,n,r,o,d,i,l,s,a,c])}(t,n,r,o,l,c,p,f),function(e,t,n,r){const{getBlocks:o,getSelectedBlocksInitialCaretPosition:i,isBlockSelected:l}=(0,E.Z)(ku),{replaceInnerBlocks:a,__unstableMarkNextChangeAsNotPersistent:s}=(0,S.Z)(ku),{innerBlocks:c}=(0,E.Z)((t=>({innerBlocks:t(ku).getBlocks(e)})),[e]),u=(0,v.useRef)(null);(0,v.useLayoutEffect)((()=>{let c=!1;return window.queueMicrotask((()=>{if(c)return;const d=o(e),p=0===d.length||"all"===n||"contentOnly"===n,m=!An()(t,u.current);if(!p||!m)return;u.current=t;const f=Lo(d,t);An()(f,d)||(s(),a(e,f,0===d.length&&r&&0!==f.length&&l(e),i()))})),()=>{c=!0}}),[c,t,n,e])}(t,i,l,s);const h=function(e){return(0,E.Z)((t=>{const n=t(ku).getBlock(e);if(!n)return;const r=t(Xt).getBlockType(n.name);return r&&0!==Object.keys(r.providesContext).length?Object.fromEntries(Object.entries(r.providesContext).map((e=>{let[t,r]=e;return[t,n.attributes[r]]}))):void 0}),[e])}(t),g=fe((0,E.Z)((e=>{var n;return null===(n=e(ku).getBlock(t))||void 0===n?void 0:n.name}),[t]),"__experimentalLayout")||DI,{allowSizingOnChildren:b=!1}=g,y=bp("layout")||DI,_=f||g,k=(0,v.useMemo)((()=>({...y,..._,...b&&{allowSizingOnChildren:!0}})),[y,_,b]);return(0,v.createElement)(_h,{value:h},(0,v.createElement)(UI,{rootClientId:t,renderAppender:d,__experimentalAppenderTagName:u,__experimentalLayout:k,wrapperRef:a,placeholder:m}))}function MI(e){return T_(e),(0,v.createElement)(RI,e)}const OI=(0,v.forwardRef)(((e,t)=>{const n=ZI({ref:t},e);return(0,v.createElement)("div",{className:"block-editor-inner-blocks"},(0,v.createElement)("div",n))}));function ZI(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:r}=t,{clientId:o,layout:i=null,__unstableLayoutClassNames:l=""}=Su(),a=(0,ch.Z)("medium","<"),{__experimentalCaptureToolbars:s,hasOverlay:c}=(0,E.Z)((e=>{if(!o)return{};const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:r,__unstableGetEditorMode:i}=e(ku),l=t(o),s="navigation"===i()||a;return{__experimentalCaptureToolbars:e(Xt).hasBlockSupport(l,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==l&&!n(o)&&!r(o,!0)&&s}}),[o,a]),u=AI({rootClientId:o}),d=(0,vl.Z)([e.ref,r?null:u]),p={__experimentalCaptureToolbars:s,layout:i,...t},m=p.value&&p.onChange?MI:RI;return{...e,ref:d,className:w()(e.className,"block-editor-block-list__layout",n?"":l,{"has-overlay":c}),children:o?(0,v.createElement)(m,(0,Po.Z)({},p,{clientId:o})):(0,v.createElement)(UI,t)}}ZI.save=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=yn,n=Cn(t,{isInnerBlocks:!0}),r=(0,v.createElement)(pn.Z,null,n);return{...e,children:r}},OI.DefaultBlockAppender=bI,OI.ButtonBlockAppender=vI,OI.Content=()=>ZI.save().children;var FI=OI;const jI=(0,v.createContext)(),zI=(0,v.createContext)(),HI=new WeakMap;function VI(e){let{className:t,...n}=e;const[r,o]=(0,v.useState)(),i=(0,ch.Z)("medium"),{isOutlineMode:l,isFocusMode:a,editorMode:s}=(0,E.Z)((e=>{const{getSettings:t,__unstableGetEditorMode:n}=e(ku),{outlineMode:r,focusMode:o}=t();return{isOutlineMode:r,isFocusMode:o,editorMode:n()}}),[]),c=(0,yl.Z)(),{setBlockVisibility:u}=(0,S.Z)(ku),d=(0,uh.Z)((0,v.useCallback)((()=>{const e={};HI.get(c).forEach((t=>{let[n,r]=t;e[n]=r})),u(e)}),[c]),300,{trailing:!0}),p=(0,v.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{HI.get(c)||HI.set(c,[]);for(const t of e){const e=t.target.getAttribute("data-block");HI.get(c).push([e,t.isIntersecting])}d()}))}),[]),m=ZI({ref:(0,vl.Z)([O_(),RC(),o]),className:w()("is-root-container",t,{"is-outline-mode":l,"is-focus-mode":a&&i,"is-navigate-mode":"navigation"===s})},n);return(0,v.createElement)(jI.Provider,{value:r},(0,v.createElement)(zI.Provider,{value:p},(0,v.createElement)("div",m)))}function WI(e){return function(){const{patterns:e,isPreviewMode:t}=(0,E.Z)((e=>{const{__experimentalBlockPatterns:t,__unstableIsPreviewMode:n}=e(ku).getSettings();return{patterns:t,isPreviewMode:n}}),[]);(0,v.useEffect)((()=>{if(t)return;if(null==e||!e.length)return;let n,r=-1;const o=()=>{r++,r>=e.length||((0,$.select)(ku).__experimentalGetParsedPattern(e[r].name),n=MC(o))};return n=MC(o),()=>OC(n)}),[e,t])}(),(0,v.createElement)(hI,null,(0,v.createElement)(Eu,{value:wu},(0,v.createElement)(VI,e)))}function $I(e){let{placeholder:t,rootClientId:n,renderAppender:r,__experimentalAppenderTagName:o,__experimentalLayout:i=zm}=e;const{order:l,selectedBlocks:a,visibleBlocks:s}=(0,E.Z)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:o}=e(ku);return{order:t(n),selectedBlocks:r(),visibleBlocks:o()}}),[n]);return(0,v.createElement)(Vm,{value:i},l.map((e=>(0,v.createElement)(sh.ZP,{key:e,value:!s.has(e)&&!a.includes(e)},(0,v.createElement)(e_,{rootClientId:n,clientId:e})))),l.length<1&&t,(0,v.createElement)(CC,{tagName:o,rootClientId:n,renderAppender:r}))}function UI(e){return(0,v.createElement)(sh.ZP,{value:!1},(0,v.createElement)($I,e))}WI.__unstableElementContext=jI;const GI=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?$/,qI=["top","right","bottom","left"],KI=["color","style","width"],YI=e=>!e||!KI.some((t=>void 0!==e[t])),XI=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).some((e=>-1!==qI.indexOf(e)))},JI=e=>{if(!XI(e))return!1;const t=qI.map((t=>QI(null==e?void 0:e[t])));return!t.every((e=>e===t[0]))},QI=(e,t)=>{if(YI(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:l=r,width:a=o}=e;return[a,a&&"0"!==a||i?l||"solid":l,i].filter(Boolean).join(" ")},eT=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(GI);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e))),tT=()=>{};var nT=(0,Ku.Iq)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){var t,n,r;const{className:o,hasValue:i,isShownByDefault:l=!1,label:a,panelId:s,resetAllFilter:c=tT,onDeselect:u,onSelect:d,...p}=(0,qu.y)(e,"ToolsPanelItem"),{panelId:m,menuItems:f,registerResetAllFilter:h,deregisterResetAllFilter:g,registerPanelItem:b,deregisterPanelItem:y,flagItemCustomization:_,isResetting:k,shouldRenderPlaceholderItems:x,firstDisplayedItem:w,lastDisplayedItem:C,__experimentalFirstVisibleItemClass:E,__experimentalLastVisibleItemClass:S}=hf(),I=(0,v.useCallback)(i,[s,i]),T=(0,v.useCallback)(c,[s,c]),N=(0,pd.Z)(m),B=m===s||null===m;(0,v.useEffect)((()=>(B&&null!==N&&b({hasValue:I,isShownByDefault:l,label:a,panelId:s}),()=>{(null===N&&m||m===s)&&y(a)})),[m,B,l,a,I,s,N,b,y]),(0,v.useEffect)((()=>(B&&h(T),()=>{B&&g(T)})),[h,g,T,B]);const L=l?"default":"optional",P=null==f||null===(t=f[L])||void 0===t?void 0:t[a],A=(0,pd.Z)(P),D=void 0!==(null==f||null===(n=f[L])||void 0===n?void 0:n[a]),R=i(),M=(0,pd.Z)(R),O=R&&!M;(0,v.useEffect)((()=>{O&&(l||null===m)&&_(a,L)}),[m,O,l,L,a,_]),(0,v.useEffect)((()=>{D&&!k&&B&&(!P||R||A||null==d||d(),!P&&A&&(null==u||u()))}),[B,P,D,k,R,A,d,u]);const Z=l?void 0!==(null==f||null===(r=f[L])||void 0===r?void 0:r[a]):P,F=(0,Yu.I)(),j=(0,v.useMemo)((()=>F(Of,x&&!Z&&Zf,o,w===a&&E,C===a&&S)),[Z,x,o,F,w,C,E,S,a]);return{...p,isShown:Z,shouldRenderPlaceholder:x,className:j}}(e);return r?(0,v.createElement)(md.Z,(0,Po.Z)({},i,{ref:t}),n):o?(0,v.createElement)(md.Z,(0,Po.Z)({},i,{ref:t})):null}),"ToolsPanelItem"),rT=n(12234),oT=n(59067);const iT=(0,Qu.iv)("",""),lT={name:"bjn8wh",styles:"position:relative"},aT=e=>{const{color:t=ed.D.gray[200],style:n="solid",width:r=td.Z.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==td.Z.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},sT={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};var cT=(0,Ku.Iq)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,qu.y)(e,"BorderBoxControlLinkedButton"),o=(0,Yu.I)();return{...r,className:(0,v.useMemo)((()=>o((e=>(0,Qu.iv)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,Up.b)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,N.__)("Unlink sides"):(0,N.__)("Link sides");return(0,v.createElement)(Ld.Z,{text:i},(0,v.createElement)(md.Z,{className:n},(0,v.createElement)(Mo.ZP,(0,Po.Z)({},o,{isSmall:!0,icon:r?rT.Z:oT.Z,iconSize:24,"aria-label":i,ref:t}))))}),"BorderBoxControlLinkedButton");var uT=(0,Ku.Iq)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,qu.y)(e,"BorderBoxControlVisualizer"),i=(0,Yu.I)();return{...o,className:(0,v.useMemo)((()=>i(((e,t)=>(0,Qu.iv)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",aT(null==e?void 0:e.top),";border-bottom:",aT(null==e?void 0:e.bottom),";",(0,Up.b)({borderLeft:aT(null==e?void 0:e.left)})()," ",(0,Up.b)({borderRight:aT(null==e?void 0:e.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({},r,{ref:t}))}),"BorderBoxControlVisualizer"),dT=n(15128),pT=n(89552),mT=n(38189),fT=n(24619),hT=n(31334);const gT={name:"f3vz0n",styles:"font-weight:500"},vT=(0,Qu.iv)("box-shadow:inset 0 0 0 ",td.Z.borderWidth," ",ed.D.ui.borderFocus,";",""),bT=(0,Qu.iv)("border:0;padding:0;margin:0;",hT.p,";",""),yT=(0,Qu.iv)(Yp,"{flex:0 0 auto;}",""),_T=(0,Qu.iv)("width:",228,"px;>div:first-of-type>",Pf.ar,"{margin-bottom:0;",gT,";}&& ",Pf.ar,"+button:not( .has-text ){min-width:24px;padding:0;}",""),kT=(0,Qu.iv)("",""),xT=(0,Qu.iv)("",""),wT=(0,Qu.iv)("justify-content:center;width:100%;&&{border-top:",td.Z.borderWidth," solid ",ed.D.gray[200],";border-top-left-radius:0;border-top-right-radius:0;height:46px;}",""),CT=(0,Qu.iv)(Pf.ar,"{",gT,";}",""),ET={name:"1486260",styles:"&&&&&{min-width:30px;width:30px;height:30px;padding:3px;}"},ST=[{label:(0,N.__)("Solid"),icon:pT.Z,value:"solid"},{label:(0,N.__)("Dashed"),icon:mT.Z,value:"dashed"},{label:(0,N.__)("Dotted"),icon:fT.Z,value:"dotted"}],IT=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,v.createElement)(n_.Z,{as:"label"},t):(0,v.createElement)(Pf.ar,null,t):null};var TT=(0,Ku.Iq)(((e,t)=>{const{buttonClassName:n,hideLabelFromVision:r,label:o,onChange:i,value:l,...a}=function(e){const{className:t,...n}=(0,qu.y)(e,"BorderControlStylePicker"),r=(0,Yu.I)();return{...n,className:(0,v.useMemo)((()=>r(CT,t)),[t,r]),buttonClassName:(0,v.useMemo)((()=>r(ET)),[r])}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({},a,{ref:t}),(0,v.createElement)(IT,{label:o,hideLabelFromVision:r}),(0,v.createElement)(Uu.Z,{justify:"flex-start",gap:1},ST.map((e=>(0,v.createElement)(Mo.ZP,{key:e.value,className:n,icon:e.icon,isSmall:!0,isPressed:e.value===l,onClick:()=>i(e.value===l?void 0:e.value),"aria-label":e.label,label:e.label,showTooltip:!0})))))}),"BorderControlStylePicker"),NT=(0,v.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,v.createElement)("span",(0,Po.Z)({className:w()("component-color-indicator",n),style:{background:r},ref:t},o))})),BT=n(38241),LT=n(43834);function PT(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,LT.uZ)(e,t,n)}`)}const AT=()=>(0,Qu.iv)({height:30,minHeight:30},"",""),DT=(0,Ju.Z)("div",{target:"e1epgpqk14"})({name:"1se47kl",styles:"-webkit-tap-highlight-color:transparent;align-items:flex-start;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%"}),RT=(0,Ju.Z)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",(e=>{let{color:t=ed.D.ui.borderFocus}=e;return(0,Qu.iv)({color:t},"","")}),";",AT,";",(e=>{let{marks:t,__nextHasNoMarginBottom:n}=e;return n?"":(0,Qu.iv)({marginBottom:t?16:void 0},"","")}),";"),MT=(0,Ju.Z)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,Up.b)({marginRight:6}),";"),OT=(0,Ju.Z)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,Up.b)({marginLeft:6}),";"),ZT=(0,Ju.Z)("span",{target:"e1epgpqk10"})("background-color:",ed.D.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",(e=>{let{disabled:t,railColor:n}=e,r=n||"";return t&&(r=ed.D.ui.backgroundDisabled),(0,Qu.iv)({background:r},"","")}),";"),FT=(0,Ju.Z)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",(e=>{let{disabled:t,trackColor:n}=e,r=n||"currentColor";return t&&(r=ed.D.gray[400]),(0,Qu.iv)({background:r},"","")}),";"),jT=(0,Ju.Z)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),zT=(0,Ju.Z)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",(e=>{let{disabled:t,isFilled:n}=e,r=n?"currentColor":ed.D.gray[300];return t&&(r=ed.D.gray[400]),(0,Qu.iv)({backgroundColor:r},"","")}),";"),HT=(0,Ju.Z)("span",{target:"e1epgpqk6"})("color:",ed.D.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",(e=>{let{isFilled:t}=e;return(0,Qu.iv)({color:t?ed.D.gray[700]:ed.D.gray[300]},"","")}),";"),VT=e=>{let{disabled:t}=e;return t?(0,Qu.iv)("background-color:",ed.D.gray[400],";",""):(0,Qu.iv)("background-color:",ed.D.ui.theme,";","")},WT=(0,Ju.Z)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",VT,";",(0,Up.b)({marginLeft:-10}),";",(0,Up.b)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),$T=(0,Ju.Z)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",VT,";",(e=>{let{isFocused:t}=e;return t?(0,Qu.iv)("&::before{content:' ';position:absolute;background-color:",ed.D.ui.theme,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):""}),";"),UT=(0,Ju.Z)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );");var GT={name:"1cypxip",styles:"top:-80%"},qT={name:"1lr98c4",styles:"bottom:-80%"};const KT=(0,Ju.Z)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transition:opacity 120ms ease;user-select:none;line-height:1.4;",(e=>{let{show:t}=e;return(0,Qu.iv)({opacity:t?1:0},"","")}),";",(e=>{let{position:t}=e;return"bottom"===t?qT:GT}),";",nd("transition"),";",(0,Up.b)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),YT=(0,Ju.Z)(Gp.Z,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;width:",(0,Kp.D)(16),"!important;input[type='number']&{",AT,";}",(0,Up.b)({marginLeft:`${(0,Kp.D)(4)} !important`}),";"),XT=(0,Ju.Z)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",AT,";}",(0,Up.b)({marginLeft:8}),";");var JT=(0,v.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,v.createElement)(UT,(0,Po.Z)({},i,{"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o}))}));function QT(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,l=w()("components-range-control__mark",n&&"is-filled",t),a=w()("components-range-control__mark-label",n&&"is-filled");return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(zT,(0,Po.Z)({},i,{"aria-hidden":"true",className:l,isFilled:n,style:o})),r&&(0,v.createElement)(HT,{"aria-hidden":"true",className:a,isFilled:n,style:o},r))}function eN(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0,...a}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(ZT,(0,Po.Z)({disabled:t},a)),n&&(0,v.createElement)(tN,{disabled:t,marks:n,min:r,max:o,step:i,value:l}))}function tN(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:l=0}=e,a=function(e){let{marks:t,min:n=0,max:r=100,step:o=1,value:i=0}=e;if(!t)return[];const l=r-n;if(!Array.isArray(t)){t=[];const e=1+Math.round(l/o);for(;e>t.push({value:o*t.length+n}););}const a=[];return t.forEach(((e,t)=>{if(e.valuer)return;const o=`mark-${t}`,s=e.value<=i,c=(e.value-n)/l*100+"%",u={[(0,N.isRTL)()?"right":"left"]:c};a.push({...e,isFilled:s,key:o,style:u})})),a}({marks:n,min:r,max:o,step:"any"===i?1:i,value:l});return(0,v.createElement)(jT,{"aria-hidden":"true",className:"components-range-control__marks"},a.map((e=>(0,v.createElement)(QT,(0,Po.Z)({},e,{key:e.key,"aria-hidden":"true",disabled:t})))))}function nN(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:l=0,renderTooltipContent:a=(e=>e),zIndex:s=100,...c}=e,u=function(e){let{inputRef:t,tooltipPosition:n}=e;const[r,o]=(0,v.useState)(),i=(0,v.useCallback)((()=>{t&&t.current&&o(n)}),[n,t]);return(0,v.useEffect)((()=>{i()}),[i]),(0,v.useEffect)((()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}))),r}({inputRef:n,tooltipPosition:r}),d=w()("components-simple-tooltip",t),p={...i,zIndex:s};return(0,v.createElement)(KT,(0,Po.Z)({},c,{"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:p}),a(l))}const rN=()=>{},oN=(0,v.forwardRef)((function e(t,n){var r;const{__nextHasNoMarginBottom:o=!1,afterIcon:i,allowReset:l=!1,beforeIcon:a,className:s,color:c=ed.D.ui.theme,currentInput:u,disabled:d=!1,help:p,hideLabelFromVision:m=!1,initialPosition:f,isShiftStepEnabled:h=!0,label:g,marks:b=!1,max:y=100,min:_=0,onBlur:k=rN,onChange:x=rN,onFocus:C=rN,onMouseLeave:E=rN,onMouseMove:S=rN,railColor:I,renderTooltipContent:T=(e=>e),resetFallbackValue:B,shiftStep:L=10,showTooltip:P,step:A=1,trackColor:D,value:R,withInputField:M=!0,...O}=t,[Z,F]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,l]=(0,tm.Z)(PT(r,t,n),{initial:PT(null!=o?o:null,t,n),fallback:null});return[i,(0,v.useCallback)((e=>{l(null===e?null:PT(e,t,n))}),[t,n,l])]}({min:_,max:y,value:null!=R?R:null,initial:f}),j=(0,v.useRef)(!1);let z=P,H=M;"any"===A&&(z=!1,H=!1);const[V,W]=(0,v.useState)(z),[$,U]=(0,v.useState)(!1),G=(0,v.useRef)(),q=null===(r=G.current)||void 0===r?void 0:r.matches(":focus"),K=!d&&$,Y=null===Z,X=Y?"":void 0!==Z?Z:u,J=Y?(y-_)/2+_:Z,Q=Y?50:(Z-_)/(y-_)*100,ee=`${(0,LT.uZ)(Q,0,100)}%`,te=w()("components-range-control",s),ne=w()("components-range-control__wrapper",!!b&&"is-marked"),re=(0,dd.Z)(e,"inspector-range-control"),oe=p?`${re}__help`:void 0,ie=!1!==z&&Number.isFinite(Z),le=()=>{let e=parseFloat(`${B}`),t=e;isNaN(e)&&(e=null,t=void 0),F(e),x(t)},ae={[(0,N.isRTL)()?"right":"left"]:ee};return(0,v.createElement)(Xu.ZP,{__nextHasNoMarginBottom:o,className:te,label:g,hideLabelFromVision:m,id:`${re}`,help:p},(0,v.createElement)(DT,{className:"components-range-control__root"},a&&(0,v.createElement)(MT,null,(0,v.createElement)(Od.Z,{icon:a})),(0,v.createElement)(RT,{__nextHasNoMarginBottom:o,className:ne,color:c,marks:!!b},(0,v.createElement)(JT,(0,Po.Z)({},O,{className:"components-range-control__slider",describedBy:oe,disabled:d,id:`${re}`,label:g,max:y,min:_,onBlur:e=>{k(e),U(!1),W(!1)},onChange:e=>{const t=parseFloat(e.target.value);F(t),x(t)},onFocus:e=>{C(e),U(!0),W(!0)},onMouseMove:S,onMouseLeave:E,ref:(0,vl.Z)([G,n]),step:A,value:null!=X?X:void 0})),(0,v.createElement)(eN,{"aria-hidden":!0,disabled:d,marks:b,max:y,min:_,railColor:I,step:A,value:J}),(0,v.createElement)(FT,{"aria-hidden":!0,className:"components-range-control__track",disabled:d,style:{width:ee},trackColor:D}),(0,v.createElement)(WT,{className:"components-range-control__thumb-wrapper",style:ae,disabled:d},(0,v.createElement)($T,{"aria-hidden":!0,isFocused:K,disabled:d})),ie&&(0,v.createElement)(nN,{className:"components-range-control__tooltip",inputRef:G,tooltipPosition:"bottom",renderTooltipContent:T,show:q||V,style:ae,value:Z})),i&&(0,v.createElement)(OT,null,(0,v.createElement)(Od.Z,{icon:i})),H&&(0,v.createElement)(YT,{"aria-label":g,className:"components-range-control__number",disabled:d,inputMode:"decimal",isShiftStepEnabled:h,max:y,min:_,onBlur:()=>{j.current&&(le(),j.current=!1)},onChange:e=>{let t=parseFloat(e);F(t),isNaN(t)?l&&(j.current=!0):((t<_||t>y)&&(t=PT(t,_,y)),x(t),j.current=!1)},shiftStep:L,step:A,value:X}),l&&(0,v.createElement)(XT,null,(0,v.createElement)(Mo.ZP,{className:"components-range-control__reset",disabled:d||void 0===Z,variant:"secondary",isSmall:!0,onClick:le},(0,N.__)("Reset")))))}));var iN=oN;const lN=(0,Ju.Z)(Gp.Z,{target:"ez9hsf47"})(qp.W2,"{width:",(0,Kp.D)(24),";}"),aN=(0,Ju.Z)(BT.Z,{target:"ez9hsf46"})("margin-left:",(0,Kp.D)(-2),";width:5em;",qp.Kg,"{display:none;}"),sN=(0,Ju.Z)(iN,{target:"ez9hsf45"})("flex:1;margin-right:",(0,Kp.D)(2),";"),cN=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,Kp.D)(2)} );\n\tmargin-left: ${(0,Kp.D)(1)};\n}`,uN=(0,Ju.Z)("div",{target:"ez9hsf44"})("padding-top:",(0,Kp.D)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),dN=(0,Ju.Z)(Bf.Z,{target:"ez9hsf43"})("padding-left:",(0,Kp.D)(4),";padding-right:",(0,Kp.D)(4),";"),pN=(0,Ju.Z)(Uu.Z,{target:"ez9hsf42"})("padding-top:",(0,Kp.D)(4),";padding-left:",(0,Kp.D)(4),";padding-right:",(0,Kp.D)(3),";padding-bottom:",(0,Kp.D)(5),";"),mN=(0,Ju.Z)("div",{target:"ez9hsf41"})(hT.p,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;overflow:hidden;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,Kp.D)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,Kp.D)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",td.Z.borderWidthFocus," #fff;}",cN,";"),fN=(0,Ju.Z)(Mo.ZP,{target:"ez9hsf40"})("&&&&&{min-width:",(0,Kp.D)(6),";padding:0;>svg{margin-right:0;}}");var hN=n(79519),gN=n(63107);const vN=(0,v.createContext)({});var bN=n(60932),yN=(0,Ku.Iq)((function(e,t){const{as:n="span",shortcut:r,className:o,...i}=(0,qu.y)(e,"Shortcut");if(!r)return null;let l,a;return"string"==typeof r?l=r:(l=r.display,a=r.ariaLabel),(0,v.createElement)(md.Z,(0,Po.Z)({as:n,className:o,"aria-label":a,ref:t},i),l)}),"Shortcut");const _N=(0,Qu.iv)("z-index:",1000002,";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ",td.Z.transitionDurationFastest," ease;font-size:",td.Z.fontSize,";&[data-enter]{opacity:1;}",""),kN=(0,Ju.Z)("div",{target:"e7tfjmw1"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:",ed.D.white,";padding:4px 8px;"),xN={name:"12mkfdx",styles:"outline:none"},wN=(0,Ju.Z)(yN,{target:"e7tfjmw0"})("display:inline-block;margin-left:",(0,Kp.D)(1),";"),{TooltipPopoverView:CN}=m;var EN=(0,Ku.Iq)((function(e,t){const{children:n,className:r,...o}=(0,qu.y)(e,"TooltipContent"),{tooltip:i}=(0,v.useContext)(vN),l=(0,Yu.I)()(_N,r);return(0,v.createElement)(bN.u,(0,Po.Z)({as:md.Z},o,i,{className:l,ref:t}),(0,v.createElement)(CN,null,n))}),"TooltipContent");const SN=(0,Ku.Iq)((function(e,t){const{animated:n=!0,animationDuration:r=160,baseId:o,children:i,content:l,focusable:a=!0,gutter:s=4,id:c,modal:u=!0,placement:d,visible:p=!1,shortcut:m,...f}=(0,qu.y)(e,"Tooltip"),h=(0,hN.K)({animated:n?r:void 0,baseId:o||c,gutter:s,placement:d,visible:p,...f}),g=(0,v.useMemo)((()=>({tooltip:h})),[h]);return(0,v.createElement)(vN.Provider,{value:g},l&&(0,v.createElement)(EN,{unstable_portal:u,ref:t},l,m&&(0,v.createElement)(wN,{shortcut:m})),i&&(0,v.createElement)(gN.v,(0,Po.Z)({},h,i.props,{ref:null==i?void 0:i.ref}),(e=>(a||(e.tabIndex=void 0),(0,v.cloneElement)(i,e)))))}),"Tooltip");var IN=SN;const TN=e=>{const{color:t,colorType:n}=e,[r,o]=(0,v.useState)(null),i=(0,v.useRef)(),l=zE((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,v.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,v.createElement)(IN,{content:(0,v.createElement)(yE.Z,{color:"white"},r===t.toHex()?(0,N.__)("Copied!"):(0,N.__)("Copy")),placement:"bottom"},(0,v.createElement)(fN,{isSmall:!0,ref:l,icon:fE.Z,showTooltip:!1}))},NN=e=>{let{min:t,max:n,label:r,abbreviation:o,onChange:i,value:l}=e;return(0,v.createElement)(Bf.Z,{spacing:4},(0,v.createElement)(lN,{min:t,max:n,label:r,hideLabelFromVision:!0,value:l,onChange:e=>{i(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,v.createElement)(cw.Z,{as:yE.Z,paddingLeft:(0,Kp.D)(4),color:ed.D.ui.theme,lineHeight:1},o),spinControls:"none",size:"__unstable-large"}),(0,v.createElement)(sN,{__nextHasNoMarginBottom:!0,label:r,hideLabelFromVision:!0,min:t,max:n,value:l,onChange:i,withInputField:!1}))},BN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{r:o,g:i,b:l,a:a}=t.toRgb();return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(NN,{min:0,max:255,label:"Red",abbreviation:"R",value:o,onChange:e=>n((0,G.Vi)({r:e,g:i,b:l,a:a}))}),(0,v.createElement)(NN,{min:0,max:255,label:"Green",abbreviation:"G",value:i,onChange:e=>n((0,G.Vi)({r:o,g:e,b:l,a:a}))}),(0,v.createElement)(NN,{min:0,max:255,label:"Blue",abbreviation:"B",value:l,onChange:e=>n((0,G.Vi)({r:o,g:i,b:e,a:a}))}),r&&(0,v.createElement)(NN,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>n((0,G.Vi)({r:o,g:i,b:l,a:e/100}))}))},LN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;const{h:o,s:i,l:l,a:a}=t.toHsl();return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(NN,{min:0,max:359,label:"Hue",abbreviation:"H",value:o,onChange:e=>{n((0,G.Vi)({h:e,s:i,l:l,a:a}))}}),(0,v.createElement)(NN,{min:0,max:100,label:"Saturation",abbreviation:"S",value:i,onChange:e=>{n((0,G.Vi)({h:o,s:e,l:l,a:a}))}}),(0,v.createElement)(NN,{min:0,max:100,label:"Lightness",abbreviation:"L",value:l,onChange:e=>{n((0,G.Vi)({h:o,s:i,l:e,a:a}))}}),r&&(0,v.createElement)(NN,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a),onChange:e=>{n((0,G.Vi)({h:o,s:i,l:l,a:e/100}))}}))};var PN=n(87230);const AN=e=>{let{color:t,onChange:n,enableAlpha:r}=e;return(0,v.createElement)(PN.gs,{prefix:(0,v.createElement)(cw.Z,{as:yE.Z,marginLeft:(0,Kp.D)(4),color:ed.D.ui.theme,lineHeight:1},"#"),value:t.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const t=e.startsWith("#")?e:"#"+e;n((0,G.Vi)(t))},maxLength:r?9:7,label:(0,N.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{var n,r,o,i;const l=null===(n=t.payload)||void 0===n||null===(r=n.event)||void 0===r?void 0:r.nativeEvent;if("insertFromPaste"!==(null==l?void 0:l.inputType))return{...e};const a=null!==(o=e.value)&&void 0!==o&&o.startsWith("#")?e.value.slice(1).toUpperCase():null===(i=e.value)||void 0===i?void 0:i.toUpperCase();return{...e,value:a}},__unstableInputWidth:"9em"})},DN=e=>{let{colorType:t,color:n,onChange:r,enableAlpha:o}=e;const i={color:n,onChange:r,enableAlpha:o};switch(t){case"hsl":return(0,v.createElement)(LN,i);case"rgb":return(0,v.createElement)(BN,i);default:return(0,v.createElement)(AN,i)}};var RN=n(82471);const MN=e=>{let{color:t,enableAlpha:n,onChange:r}=e;const o=n?RN.ef:RN.W_,i=(0,v.useMemo)((()=>t.toRgbString()),[t]);return(0,v.createElement)(o,{color:i,onChange:e=>{r((0,G.Vi)(e))}})};(0,G.l7)([q.Z]);const ON=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],ZN=(0,Ku.Iq)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:l,...a}=(0,qu.y)(e,"ColorPicker"),[s,c]=function(e){let{defaultValue:t,onChange:n,value:r}=e;const o=void 0!==r,i=o?r:t,[l,a]=(0,v.useState)(i);let s;return s=o&&"function"==typeof n?n:o||"function"!=typeof n?a:e=>{n(e),a(e)},[o?r:l,s]}({onChange:o,value:r,defaultValue:i}),u=(0,v.useMemo)((()=>(0,G.Vi)(s||"")),[s]),d=(0,uh.Z)(c),p=(0,v.useCallback)((e=>{d(e.toHex())}),[d]),[m,f]=(0,v.useState)(l||"hex");return(0,v.createElement)(mN,(0,Po.Z)({ref:t},a),(0,v.createElement)(MN,{onChange:p,color:u,enableAlpha:n}),(0,v.createElement)(uN,null,(0,v.createElement)(dN,{justify:"space-between"},(0,v.createElement)(aN,{__nextHasNoMarginBottom:!0,options:ON,value:m,onChange:e=>f(e),label:(0,N.__)("Color format"),hideLabelFromVision:!0}),(0,v.createElement)(TN,{color:u,colorType:l||m})),(0,v.createElement)(pN,{direction:"column",gap:2},(0,v.createElement)(DN,{colorType:m,color:u,onChange:p,enableAlpha:n}))))}),"ColorPicker");var FN=ZN;function jN(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const zN=fr()((e=>{const t=(0,G.Vi)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}})),HN=e=>(0,v.createElement)(FN,function(e){const{onChangeComplete:t}=e,n=(0,v.useCallback)((e=>{t(zN(e))}),[t]);return function(e){var t;return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof(null===(t=e.color)||void 0===t?void 0:t.hex)}(e)?{color:jN(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}(e));function VN(e){const{actions:t,className:n,options:r,children:o}=e;return(0,v.createElement)("div",{className:w()("components-circular-option-picker",n)},(0,v.createElement)("div",{className:"components-circular-option-picker__swatches"},r),o,t&&(0,v.createElement)("div",{className:"components-circular-option-picker__custom-clear-wrapper"},t))}VN.Option=function(e){let{className:t,isSelected:n,selectedIconProps:r,tooltipText:o,...i}=e;const l=(0,v.createElement)(Mo.ZP,(0,Po.Z)({isPressed:n,className:"components-circular-option-picker__option"},i));return(0,v.createElement)("div",{className:w()(t,"components-circular-option-picker__option-wrapper")},o?(0,v.createElement)(Ld.Z,{text:o},l):l,n&&(0,v.createElement)(om.Z,(0,Po.Z)({icon:If.Z},r||{})))},VN.ButtonAction=function(e){let{className:t,children:n,...r}=e;return(0,v.createElement)(Mo.ZP,(0,Po.Z)({className:w()("components-circular-option-picker__clear",t),variant:"tertiary"},r),n)},VN.DropdownLinkAction=function(e){let{buttonProps:t,className:n,dropdownProps:r,linkText:o}=e;return(0,v.createElement)(t_.Z,(0,Po.Z)({className:w()("components-circular-option-picker__dropdown-link-action",n),renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,v.createElement)(Mo.ZP,(0,Po.Z)({"aria-expanded":n,"aria-haspopup":"true",onClick:r,variant:"link"},t),o)}},r))};var WN=VN;const $N=(0,Ju.Z)(Lf.Z,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),UN=(0,Ju.Z)("div",{target:"eovvns30"})("margin-left:",(0,Kp.D)(-2),";margin-right:",(0,Kp.D)(-2),";&:first-of-type{margin-top:",(0,Kp.D)(-2),";}&:last-of-type{margin-bottom:",(0,Kp.D)(-2),";}",(e=>{let{paddingSize:t="small"}=e;if("none"===t)return;const n={small:(0,Kp.D)(2),medium:(0,Kp.D)(4)};return(0,Qu.iv)("padding:",n[t]||n.small,";","")}),";");var GN=(0,Ku.Iq)((function(e,t){const{paddingSize:n="small",...r}=(0,qu.y)(e,"DropdownContentWrapper");return(0,v.createElement)(UN,(0,Po.Z)({},r,{paddingSize:n,ref:t}))}),"DropdownContentWrapper");(0,G.l7)([q.Z,K.Z]);const qN=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function KN(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:l}=e;const a=(0,v.useMemo)((()=>r.map(((e,t)=>{let{color:r,name:l}=e;const a=(0,G.Vi)(r),s=i===r;return(0,v.createElement)(WN.Option,{key:`${r}-${t}`,isSelected:s,selectedIconProps:s?{fill:a.contrast()>a.contrast("#000")?"#fff":"#000"}:{},tooltipText:l||(0,N.sprintf)((0,N.__)("Color code: %s"),r),style:{backgroundColor:r,color:r},onClick:s?n:()=>o(r,t),"aria-label":l?(0,N.sprintf)((0,N.__)("Color: %s"),l):(0,N.sprintf)((0,N.__)("Color code: %s"),r)})}))),[r,i,o,n]);return(0,v.createElement)(WN,{className:t,options:a,actions:l})}function YN(e){let{className:t,clearColor:n,colors:r,onChange:o,value:i,actions:l,headingLevel:a}=e;return 0===r.length?null:(0,v.createElement)(sw.Z,{spacing:3,className:t},r.map(((e,t)=>{let{name:s,colors:c}=e;return(0,v.createElement)(sw.Z,{spacing:2,key:t},(0,v.createElement)($N,{level:a},s),(0,v.createElement)(KN,{clearColor:n,colors:c,onChange:e=>o(e,t),value:i,actions:r.length===t+1?l:null}))})))}function XN(e){let{isRenderedInSidebar:t,popoverProps:n,...r}=e;const o=(0,v.useMemo)((()=>({shift:!0,...t?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...n})),[t,n]);return(0,v.createElement)(t_.Z,(0,Po.Z)({contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:o},r))}(0,G.l7)([q.Z,K.Z]);const JN=(0,v.forwardRef)((function(e,t){const{clearable:n=!0,colors:r=[],disableCustomColors:o=!1,enableAlpha:i=!1,onChange:l,value:a,__experimentalIsRenderedInSidebar:s=!1,headingLevel:c=2,...u}=e,[d,p]=(0,v.useState)(a),m=(0,v.useCallback)((()=>l(void 0)),[l]),f=(0,v.useCallback)((e=>{p(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=null==r?void 0:r.getComputedStyle(t).backgroundColor;return o?(0,G.Vi)(o).toHex():e})(a,e))}),[a]),h=qN(r),g=(0,v.useMemo)((()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,G.Vi)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,G.Vi)(n).toHex()))return t;return(0,N.__)("Custom")}(a,r,h)),[a,r,h]),b=(0,G.Vi)(null!=d?d:""),y=null!=a&&a.startsWith("#")?a.substring(1):null!=a?a:"",_=y?(0,N.sprintf)((0,N.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),g,y):(0,N.__)("Custom color picker."),k={clearable:n,clearColor:m,onChange:l,value:a,actions:!!n&&(0,v.createElement)(WN.ButtonAction,{onClick:m},(0,N.__)("Clear")),headingLevel:c};return(0,v.createElement)(sw.Z,(0,Po.Z)({spacing:3,ref:t},u),!o&&(0,v.createElement)(XN,{isRenderedInSidebar:s,renderContent:()=>(0,v.createElement)(GN,{paddingSize:"none"},(0,v.createElement)(HN,{color:d,onChange:e=>l(e),enableAlpha:i})),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,v.createElement)(Uu.Z,{as:"button",ref:f,justify:"space-between",align:"flex-start",className:"components-color-palette__custom-color","aria-expanded":t,"aria-haspopup":"true",onClick:n,"aria-label":_,style:(r=a,void 0===r||0===(0,G.Vi)(r).alpha()?{color:"#000"}:{background:a,color:b.contrast()>b.contrast("#000")?"#fff":"#000"})},(0,v.createElement)(Gu.Z,{isBlock:!0,as:Uk,className:"components-color-palette__custom-color-name"},g),(0,v.createElement)(Gu.Z,{as:"span",className:"components-color-palette__custom-color-value"},y));var r}}),h?(0,v.createElement)(YN,(0,Po.Z)({},k,{colors:r})):(0,v.createElement)(KN,(0,Po.Z)({},k,{colors:r})))}));var QN=JN;function eB(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:l,previousStyleSelection:a,size:s="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,qu.y)(e,"BorderControlDropdown"),[d]=Hp(null==t?void 0:t.width),p=0===d,m=(0,Yu.I)(),f=(0,v.useMemo)((()=>m((e=>(0,Qu.iv)("background:#fff;&&>button{height:","__unstable-large"===e?"40px":"30px",";width:","__unstable-large"===e?"40px":"30px",";padding:0;display:flex;align-items:center;justify-content:center;",(0,Up.b)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",td.Z.borderWidth," solid ",ed.D.ui.border,";&:focus,&:hover:not( :disabled ){",vT," border-color:",ed.D.ui.borderFocus,";z-index:1;position:relative;}}",""))(s),n)),[n,m,s]),h=(0,v.useMemo)((()=>m(xT)),[m]),g=(0,v.useMemo)((()=>m(((e,t)=>{const{style:n}=e||{};return(0,Qu.iv)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?ed.D.gray[300]:void 0;return(0,Qu.iv)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,Kp.D)(4),";width:",(0,Kp.D)(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")})(t,s))),[t,m,s]),b=(0,v.useMemo)((()=>m(_T)),[m]),y=(0,v.useMemo)((()=>m(kT)),[m]),_=(0,v.useMemo)((()=>m(wT)),[m]);return{...u,border:t,className:f,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:h,indicatorWrapperClassName:g,onColorChange:e=>{const n="none"===(null==t?void 0:t.style)?a:null==t?void 0:t.style,r=p&&e?"1px":null==t?void 0:t.width;l({color:e,style:n,width:r})},onStyleChange:e=>{const n=p&&e?"1px":null==t?void 0:t.width;l({...t,style:e,width:n})},onReset:()=>{l({...t,color:void 0,style:void 0})},popoverContentClassName:y,popoverControlsClassName:b,resetButtonClassName:_,__experimentalIsRenderedInSidebar:c}}const tB=(0,Ku.Iq)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:l,enableStyle:a,indicatorClassName:s,indicatorWrapperClassName:c,onReset:u,onColorChange:d,onStyleChange:p,popoverContentClassName:m,popoverControlsClassName:f,resetButtonClassName:h,showDropdownHeader:g,__unstablePopoverProps:b,...y}=eB(e),{color:_,style:k}=r||{},x=((e,t)=>{if(e&&t){if(qN(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),w=((e,t,n,r)=>r?t?n?(0,N.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,t.color,n):(0,N.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?n?(0,N.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',e,n):(0,N.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',e):(0,N.__)("Border color and style picker."):t?(0,N.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,t.color):e?(0,N.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',e):(0,N.__)("Border color picker."))(_,x,k,a),C=_||k&&"none"!==k,E=n?"bottom left":void 0;return(0,v.createElement)(t_.Z,(0,Po.Z)({renderToggle:e=>{let{onToggle:t}=e;return(0,v.createElement)(Mo.ZP,{onClick:t,variant:"tertiary","aria-label":w,tooltipPosition:E,label:(0,N.__)("Border color and style picker"),showTooltip:!0},(0,v.createElement)("span",{className:c},(0,v.createElement)(NT,{className:s,colorValue:_})))},renderContent:e=>{let{onClose:t}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(GN,{paddingSize:"medium"},(0,v.createElement)(sw.Z,{className:f,spacing:6},g?(0,v.createElement)(Bf.Z,null,(0,v.createElement)(Pf.ar,null,(0,N.__)("Border color")),(0,v.createElement)(Mo.ZP,{isSmall:!0,label:(0,N.__)("Close border color"),icon:dT.Z,onClick:t})):void 0,(0,v.createElement)(QN,{className:m,value:_,onChange:d,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:l}),a&&(0,v.createElement)(TT,{label:(0,N.__)("Style"),value:k,onChange:p}))),C&&(0,v.createElement)(GN,{paddingSize:"none"},(0,v.createElement)(Mo.ZP,{className:h,variant:"tertiary",onClick:()=>{u(),t()}},(0,N.__)("Reset to default"))))},popoverProps:{...b}},y,{ref:t}))}),"BorderControlDropdown");var nB=tB;const rB=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,v.createElement)(n_.Z,{as:"legend"},t):(0,v.createElement)(Pf.ar,{as:"legend"},t):null},oB=(0,Ku.Iq)(((e,t)=>{const{colors:n,disableCustomColors:r,disableUnits:o,enableAlpha:i,enableStyle:l,hideLabelFromVision:a,innerWrapperClassName:s,inputWidth:c,label:u,onBorderChange:d,onSliderChange:p,onWidthChange:m,placeholder:f,__unstablePopoverProps:h,previousStyleSelection:g,showDropdownHeader:b,size:y,sliderClassName:_,value:k,widthUnit:x,widthValue:w,withSlider:C,__experimentalIsRenderedInSidebar:E,...S}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:l=!0,shouldSanitizeBorder:a=!0,size:s="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,...p}=(0,qu.y)(e,"BorderControl"),[m,f]=Hp(null==c?void 0:c.width),h=f||"px",g=0===m,[b,y]=(0,v.useState)(),[_,k]=(0,v.useState)(),x=(0,v.useCallback)((e=>{if(a)return o((e=>{const t=void 0===(null==e?void 0:e.width)||""===e.width,n=void 0===(null==e?void 0:e.color);if(!t||!n)return e})(e));o(e)}),[o,a]),w=(0,v.useCallback)((e=>{const t=""===e?void 0:e,[n]=Hp(e),r=0===n,o={...c,width:t};r&&!g&&(y(null==c?void 0:c.color),k(null==c?void 0:c.style),o.color=void 0,o.style="none"),!r&&g&&(void 0===o.color&&(o.color=b),"none"===o.style&&(o.style=_)),x(o)}),[c,g,b,_,x]),C=(0,v.useCallback)((e=>{w(`${e}${h}`)}),[w,h]),E=(0,Yu.I)(),S=(0,v.useMemo)((()=>E(bT,t)),[t,E]);let I=u;r&&(I="__unstable-large"===s?"116px":"90px");const T=(0,v.useMemo)((()=>{const e=!!I&&yT,t=(e=>(0,Qu.iv)("height:","__unstable-large"===e?"40px":"30px",";",""))(s);return E((0,Qu.iv)(Yp,"{flex:1 1 40%;}&& ",Qp,"{min-height:0;}",""),e,t)}),[I,E,s]),N=(0,v.useMemo)((()=>E((0,Qu.iv)("flex:1 1 60%;",(0,Up.b)({marginRight:(0,Kp.D)(3)})(),";",""))),[E]);return{...p,className:S,colors:n,enableAlpha:i,enableStyle:l,innerWrapperClassName:T,inputWidth:I,onBorderChange:x,onSliderChange:C,onWidthChange:w,previousStyleSelection:_,sliderClassName:N,value:c,widthUnit:h,widthValue:m,size:s,__experimentalIsRenderedInSidebar:d}}(e);return(0,v.createElement)(md.Z,(0,Po.Z)({as:"fieldset"},S,{ref:t}),(0,v.createElement)(rB,{label:u,hideLabelFromVision:a}),(0,v.createElement)(Bf.Z,{spacing:4,className:s},(0,v.createElement)(rm,{prefix:(0,v.createElement)(nB,{border:k,colors:n,__unstablePopoverProps:h,disableCustomColors:r,enableAlpha:i,enableStyle:l,onChange:d,previousStyleSelection:g,showDropdownHeader:b,__experimentalIsRenderedInSidebar:E,size:y}),label:(0,N.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:(null==k?void 0:k.width)||"",placeholder:f,disableUnits:o,__unstableInputWidth:c,size:y}),C&&(0,v.createElement)(iN,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:p,step:["px","%"].includes(x)?1:.1,value:w||void 0,withInputField:!1})))}),"BorderControl");var iB=oB;var lB=(0,Ku.Iq)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,onChange:a,popoverPlacement:s,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:p,__experimentalIsRenderedInSidebar:m,...f}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:l=!1,...a}=(0,qu.y)(e,"BorderBoxControlSplitControls"),s=(0,Yu.I)(),c=(0,v.useMemo)((()=>s((e=>(0,Qu.iv)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[s,t,i]);return{...a,centeredClassName:(0,v.useMemo)((()=>s(sT,t)),[s,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,v.useMemo)((()=>s((0,Qu.iv)((0,Up.b)({marginLeft:"auto"})(),";",""),t)),[s,t]),size:i,__experimentalIsRenderedInSidebar:l}}(e),[h,g]=(0,v.useState)(null),b=(0,v.useMemo)((()=>s?{placement:s,offset:c,anchor:h,shift:!0}:void 0),[s,c,h]),y={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:l,isCompact:!0,__experimentalIsRenderedInSidebar:m,size:d},_=(0,vl.Z)([g,t]);return(0,v.createElement)(Kf,(0,Po.Z)({},f,{ref:_,gap:4}),(0,v.createElement)(uT,{value:p,size:d}),(0,v.createElement)(iB,(0,Po.Z)({className:n,hideLabelFromVision:!0,label:(0,N.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:null==p?void 0:p.top},y)),(0,v.createElement)(iB,(0,Po.Z)({hideLabelFromVision:!0,label:(0,N.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:null==p?void 0:p.left},y)),(0,v.createElement)(iB,(0,Po.Z)({className:u,hideLabelFromVision:!0,label:(0,N.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:null==p?void 0:p.right},y)),(0,v.createElement)(iB,(0,Po.Z)({className:n,hideLabelFromVision:!0,label:(0,N.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:null==p?void 0:p.bottom},y)))}),"BorderBoxControlSplitControls");function aB(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:l="default",value:a,__experimentalIsRenderedInSidebar:s=!1,...c}=(0,qu.y)(e,"BorderBoxControl"),u=JI(a),d=XI(a),p=d?(e=>{if(!e)return;const t=[],n=[],r=[];qI.forEach((o=>{var i,l,a;t.push(null===(i=e[o])||void 0===i?void 0:i.color),n.push(null===(l=e[o])||void 0===l?void 0:l.style),r.push(null===(a=e[o])||void 0===a?void 0:a.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),l=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:l?r[0]:eT(r)}})(a):a,m=d?a:(e=>{if(e&&!YI(e))return{top:e,right:e,bottom:e,left:e}})(a),f=!isNaN(parseFloat(`${null==p?void 0:p.width}`)),[h,g]=(0,v.useState)(!u),b=(0,Yu.I)(),y=(0,v.useMemo)((()=>b(iT,t)),[b,t]),_=(0,v.useMemo)((()=>b((0,Qu.iv)("flex:1;",(0,Up.b)({marginRight:"24px"})(),";",""))),[b]),k=(0,v.useMemo)((()=>b(lT)),[b]);return{...c,className:y,colors:n,disableUnits:u&&!f,enableAlpha:o,enableStyle:i,hasMixedBorders:u,isLinked:h,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!u||(t=e)&&KI.every((e=>void 0!==t[e])))return r(YI(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(p,e),o={top:{...null==a?void 0:a.top,...n},right:{...null==a?void 0:a.right,...n},bottom:{...null==a?void 0:a.bottom,...n},left:{...null==a?void 0:a.left,...n}};if(JI(o))return r(o);const i=YI(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};JI(n)?r(n):r(e)},toggleLinked:()=>g(!h),linkedValue:p,size:l,splitValue:m,wrapperClassName:k,__experimentalIsRenderedInSidebar:s}}const sB=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,v.createElement)(n_.Z,{as:"label"},t):(0,v.createElement)(Pf.ar,null,t):null},cB=(0,Ku.Iq)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:l,enableStyle:a,hasMixedBorders:s,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:p,linkedValue:m,onLinkedChange:f,onSplitChange:h,popoverPlacement:g,popoverOffset:b,size:y,splitValue:_,toggleLinked:k,wrapperClassName:x,__experimentalIsRenderedInSidebar:w,...C}=aB(e),[E,S]=(0,v.useState)(null),I=(0,v.useMemo)((()=>g?{placement:g,offset:b,anchor:E,shift:!0}:void 0),[g,b,E]),T=(0,vl.Z)([S,t]);return(0,v.createElement)(md.Z,(0,Po.Z)({className:n},C,{ref:T}),(0,v.createElement)(sB,{label:d,hideLabelFromVision:c}),(0,v.createElement)(md.Z,{className:x},u?(0,v.createElement)(iB,{className:p,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:l,enableStyle:a,onChange:f,placeholder:s?(0,N.__)("Mixed"):void 0,__unstablePopoverProps:I,shouldSanitizeBorder:!1,value:m,withSlider:!0,width:"__unstable-large"===y?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:y}):(0,v.createElement)(lB,{colors:r,disableCustomColors:o,enableAlpha:l,enableStyle:a,onChange:h,popoverPlacement:g,popoverOffset:b,value:_,__experimentalIsRenderedInSidebar:w,size:y}),(0,v.createElement)(cT,{onClick:k,isLinked:u,size:y})))}),"BorderBoxControl");var uB=cB;function dB(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function pB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||dB(Object.values(n).filter(Boolean))||"px"}function mB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>Hp(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=dB(r),l=0===o||o?`${o}${i}`:void 0;return l}function fB(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mB(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function hB(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function gB(e){let{onChange:t,selectedUnits:n,setSelectedUnits:r,values:o,...i}=e,l=mB(o);void 0===l&&(l=pB(n));const a=hB(o)&&fB(o),s=a?(0,N.__)("Mixed"):null;return(0,v.createElement)(rm,(0,Po.Z)({},i,{"aria-label":(0,N.__)("Border radius"),disableUnits:a,isOnly:!0,value:l,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{r({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:s,size:"__unstable-large"}))}const vB={topLeft:(0,N.__)("Top left"),topRight:(0,N.__)("Top right"),bottomLeft:(0,N.__)("Bottom left"),bottomRight:(0,N.__)("Bottom right")};function bB(e){let{onChange:t,selectedUnits:n,setSelectedUnits:r,values:o,...i}=e;const l=e=>n=>{if(!t)return;const r=isNaN(parseFloat(n))?void 0:n;t({...a,[e]:r})},a="string"!=typeof o?o:{topLeft:o,topRight:o,bottomLeft:o,bottomRight:o};return(0,v.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(vB).map((e=>{let[t,o]=e;const[s,c]=Hp(a[t]),u=a[t]?c:n[t]||n.flat;return(0,v.createElement)(Ld.Z,{text:o,position:"top",key:t},(0,v.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,v.createElement)(rm,(0,Po.Z)({},i,{"aria-label":o,value:[s,u].join(""),onChange:l(t),onUnitChange:(d=t,e=>{const t={...n};t[d]=e,r(t)}),size:"__unstable-large"}))));var d})))}function yB(e){let{isLinked:t,...n}=e;const r=t?(0,N.__)("Unlink radii"):(0,N.__)("Link radii");return(0,v.createElement)(Ld.Z,{text:r},(0,v.createElement)("span",null,(0,v.createElement)(Mo.ZP,(0,Po.Z)({},n,{className:"component-border-radius-control__linked-button",isSmall:!0,icon:t?rT.Z:oT.Z,iconSize:24,"aria-label":r}))))}const _B={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},kB={px:100,em:20,rem:20};function xB(e){let{onChange:t,values:n}=e;const[r,o]=(0,v.useState)(!hB(n)||!fB(n)),[i,l]=(0,v.useState)({flat:"string"==typeof n?Hp(n)[1]:void 0,topLeft:Hp(null==n?void 0:n.topLeft)[1],topRight:Hp(null==n?void 0:n.topRight)[1],bottomLeft:Hp(null==n?void 0:n.bottomLeft)[1],bottomRight:Hp(null==n?void 0:n.bottomRight)[1]}),a=Wp({availableUnits:bp("spacing.units")||["px","em","rem"]}),s=pB(i),c=a&&a.find((e=>e.value===s)),u=(null==c?void 0:c.step)||1,[d]=Hp(mB(n));return(0,v.createElement)("fieldset",{className:"components-border-radius-control"},(0,v.createElement)(Xu.ZP.VisualLabel,{as:"legend"},(0,N.__)("Radius")),(0,v.createElement)("div",{className:"components-border-radius-control__wrapper"},r?(0,v.createElement)(v.Fragment,null,(0,v.createElement)(gB,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:i,setSelectedUnits:l,units:a}),(0,v.createElement)(iN,{label:(0,N.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:0,max:kB[s],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${s}`:void 0)},step:u,__nextHasNoMarginBottom:!0})):(0,v.createElement)(bB,{min:0,onChange:t,selectedUnits:i,setSelectedUnits:l,values:n||_B,units:a}),(0,v.createElement)(yB,{onClick:()=>o(!r),isLinked:r})))}function wB(e){var t;const{attributes:{style:n},setAttributes:r}=e;return(0,v.createElement)(xB,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=yp({...n,border:{...null==n?void 0:n.border,radius:e}});r({style:t})}})}(0,G.l7)([q.Z,K.Z]);const CB=(e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>e.slug===t));if(n)return n}return{color:n}},EB=(e,t)=>null==e?void 0:e.find((e=>e.color===t));function SB(e,t){if(e&&t)return`has-${(0,U.kebabCase)(t)}-${e}`}function IB(){const e={disableCustomColors:!bp("color.custom"),disableCustomGradients:!bp("color.customGradient")},t=bp("color.palette.custom"),n=bp("color.palette.theme"),r=bp("color.palette.default"),o=bp("color.defaultPalette");e.colors=(0,v.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,N._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,N._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,N._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[r,n,t]);const i=bp("color.gradients.custom"),l=bp("color.gradients.theme"),a=bp("color.gradients.default"),s=bp("color.defaultGradients");return e.gradients=(0,v.useMemo)((()=>{const e=[];return l&&l.length&&e.push({name:(0,N._x)("Theme","Indicates this palette comes from the theme."),gradients:l}),s&&a&&a.length&&e.push({name:(0,N._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),i&&i.length&&e.push({name:(0,N._x)("Custom","Indicates this palette is created by the user."),gradients:i}),e}),[i,l,a]),e}const TB="__experimentalBorder",NB=["top","right","bottom","left"],BB=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},LB=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},PB=e=>{let{colors:t,namedColor:n,customColor:r}=e;if(n){const e=LB(t,"slug",n);if(e)return e}if(!r)return{color:void 0};return LB(t,"color",r)||{color:r}};function AB(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function DB(e){const{attributes:t,clientId:n,setAttributes:r}=e,{style:o}=t,{colors:i}=IB(),l=RB(e.name),a=bp("border.color")&&RB(e.name,"color"),s=bp("border.radius")&&RB(e.name,"radius"),c=bp("border.style")&&RB(e.name,"style"),u=bp("border.width")&&RB(e.name,"width");if([!a,!s,!c,!u].every(Boolean)||!l)return null;const d=fe(e.name,[TB,"__experimentalDefaultControls"]),p=(null==d?void 0:d.color)||(null==d?void 0:d.width),m=((e,t)=>{const{borderColor:n,style:r}=e,{border:o}=r||{};if(n){const{color:e}=PB({colors:t,namedColor:n});return e?{...o,color:e}:o}if(!o)return o;const i={...o};return NB.forEach((e=>{var n;const r=AB(null===(n=i[e])||void 0===n?void 0:n.color);if(r){const{color:n}=PB({colors:t,namedColor:r});i[e]={...i[e],color:n}}})),i})(t,i);return(0,v.createElement)(nh,{group:"border"},(u||a)&&(0,v.createElement)(nT,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return r=null==n?void 0:n.border,!((!r||(XI(r)?qI.every((e=>YI(r[e]))):YI(r)))&&!t);var r})(e),label:(0,N.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:r}=e;const{style:o}=n;r({borderColor:void 0,style:{...o,border:yp({radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:p,resetAllFilter:BB,panelId:n},(0,v.createElement)(uB,{colors:i,enableAlpha:!0,enableStyle:c,onChange:e=>{var t;let n,l={...e};if(XI(e))l={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},NB.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var r;const n=PB({colors:i,customColor:null===(r=e[t])||void 0===r?void 0:r.color});n.slug&&(l[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,r=PB({colors:i,customColor:t});r.slug&&(n=r.slug,l.color=void 0)}const a=yp({...o,border:{radius:null==o||null===(t=o.border)||void 0===t?void 0:t.radius,...l}});r({style:a,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",size:"__unstable-large",value:m,__experimentalIsRenderedInSidebar:!0})),s&&(0,v.createElement)(nT,{hasValue:()=>function(e){var t,n;const r=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof r?Object.entries(r).some(Boolean):!!r}(e),label:(0,N.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:r}=t;n({style:MB(r,"radius")})}(e),isShownByDefault:null==d?void 0:d.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,v.createElement)(wB,e)))}function RB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==ci.Z.OS)return!1;const n=fe(e,TB);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function MB(e,t){return yp({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function OB(e,t,n){if(!RB(t,"color")||wp(t,TB,"color"))return e;const r=ZB(n),o=w()(e.className,r);return e.className=o||void 0,e}function ZB(e){var t;const{borderColor:n,style:r}=e,o=SB("border-color",n);return w()({"has-border-color":n||(null==r||null===(t=r.border)||void 0===t?void 0:t.color),[o]:!!o})}const FB=(0,Ao.o)((e=>t=>{var n,r,o,i,l,a,s,c,u;const{name:d,attributes:p}=t,{borderColor:m,style:f}=p,{colors:h}=IB();if(!RB(d,"color")||wp(d,TB,"color"))return(0,v.createElement)(e,t);const{color:g}=PB({colors:h,namedColor:m}),{color:b}=PB({colors:h,namedColor:AB(null==f||null===(n=f.border)||void 0===n||null===(r=n.top)||void 0===r?void 0:r.color)}),{color:y}=PB({colors:h,namedColor:AB(null==f||null===(o=f.border)||void 0===o||null===(i=o.right)||void 0===i?void 0:i.color)}),{color:_}=PB({colors:h,namedColor:AB(null==f||null===(l=f.border)||void 0===l||null===(a=l.bottom)||void 0===a?void 0:a.color)}),{color:k}=PB({colors:h,namedColor:AB(null==f||null===(s=f.border)||void 0===s||null===(c=s.left)||void 0===c?void 0:c.color)}),x={borderTopColor:b||g,borderRightColor:y||g,borderBottomColor:_||g,borderLeftColor:k||g};let w=t.wrapperProps;return w={...t.wrapperProps,style:{...null===(u=t.wrapperProps)||void 0===u?void 0:u.style,...x}},(0,v.createElement)(e,(0,Po.Z)({},t,{wrapperProps:w}))}));(0,_e.KJ)("blocks.registerBlockType","core/border/addAttributes",(function(e){return RB(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/border/addSaveProps",OB),(0,_e.KJ)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!RB(e,"color")||wp(e,TB,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),OB(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/border/with-border-color-palette-styles",FB);var jB=n(58567);const zB=e=>{let{__nextHasNoMarginBottom:t}=e;return t?"":(0,Qu.iv)("margin-bottom:",(0,Kp.D)(2),";","")},HB=(0,Ju.Z)(Uu.Z,{target:"eln3bjz3"})(zB,";"),VB=(0,Ju.Z)("div",{target:"eln3bjz2"})("border-radius:50%;border:",td.Z.borderWidth," solid ",ed.D.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;"),WB=(0,Ju.Z)("div",{target:"eln3bjz1"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),$B=(0,Ju.Z)("div",{target:"eln3bjz0"})("background:",ed.D.ui.theme,";border-radius:50%;border:",3,"px solid ",ed.D.ui.theme,";bottom:0;box-sizing:border-box;display:block;height:0px;left:0;margin:auto;position:absolute;right:0;top:-",16,"px;width:0px;");var UB=function(e){let{value:t,onChange:n,...r}=e;const o=(0,v.useRef)(null),i=(0,v.useRef)(),l=(0,v.useRef)(),a=e=>{var t;if(void 0!==e&&(e.preventDefault(),null===(t=e.target)||void 0===t||t.focus(),void 0!==i.current&&void 0!==n)){const{x:t,y:r}=i.current;n(function(e,t,n,r){const o=r-t,i=n-e,l=Math.atan2(o,i),a=Math.round(l*(180/Math.PI))+90;return a<0?360+a:a}(t,r,e.clientX,e.clientY))}},{startDrag:s,isDragging:c}=function(e){let{onDragStart:t,onDragMove:n,onDragEnd:r}=e;const[o,i]=(0,v.useState)(!1),l=(0,v.useRef)({onDragStart:t,onDragMove:n,onDragEnd:r});(0,jB.Z)((()=>{l.current.onDragStart=t,l.current.onDragMove=n,l.current.onDragEnd=r}),[t,n,r]);const a=(0,v.useCallback)((e=>l.current.onDragMove&&l.current.onDragMove(e)),[]),s=(0,v.useCallback)((e=>{l.current.onDragEnd&&l.current.onDragEnd(e),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),i(!1)}),[]),c=(0,v.useCallback)((e=>{l.current.onDragStart&&l.current.onDragStart(e),document.addEventListener("mousemove",a),document.addEventListener("mouseup",s),i(!0)}),[]);return(0,v.useEffect)((()=>()=>{o&&(document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s))}),[o]),{startDrag:c,endDrag:s,isDragging:o}}({onDragStart:e=>{(()=>{if(null===o.current)return;const e=o.current.getBoundingClientRect();i.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),a(e)},onDragMove:a,onDragEnd:a});return(0,v.useEffect)((()=>{c?(void 0===l.current&&(l.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=l.current||"",l.current=void 0)}),[c]),(0,v.createElement)(VB,(0,Po.Z)({ref:o,onMouseDown:s,className:"components-angle-picker-control__angle-circle",style:c?{cursor:"grabbing"}:void 0},r),(0,v.createElement)(WB,{style:t?{transform:`rotate(${t}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1},(0,v.createElement)($B,{className:"components-angle-picker-control__angle-circle-indicator"})))},GB=(0,v.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n=!1,className:r,label:o=(0,N.__)("Angle"),onChange:i,value:l,...a}=e;n||(0,St.default)("Bottom margin styles for wp.components.AnglePickerControl",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const s=w()("components-angle-picker-control",r);return(0,v.createElement)(HB,(0,Po.Z)({},a,{ref:t,__nextHasNoMarginBottom:n,className:s,gap:4}),(0,v.createElement)(Lx.Z,null,(0,v.createElement)(Gp.Z,{label:o,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===i)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;i(t)},size:"__unstable-large",step:"1",value:l,spinControls:"none",suffix:(0,v.createElement)(cw.Z,{as:yE.Z,marginBottom:0,marginRight:(0,Kp.D)(3),style:{color:ed.D.ui.theme}},"°")})),(0,v.createElement)(Gu.Z,{style:{marginBottom:(0,Kp.D)(1),marginTop:"auto"}},(0,v.createElement)(UB,{"aria-hidden":"true",value:l,onChange:i})))}));function qB(e){return Math.max(0,Math.min(100,e))}function KB(e,t,n){const r=e.slice();return r[t]=n,r}function YB(e,t,n){return function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=e[t].position,i=Math.min(o,n),l=Math.max(o,n);return e.some(((e,o)=>{let{position:a}=e;return o!==t&&(Math.abs(a-n)({placement:"bottom",offset:8})),[]),i=w()("components-custom-gradient-picker__control-point-dropdown",n);return(0,v.createElement)(XN,(0,Po.Z)({isRenderedInSidebar:t,popoverProps:o,className:i},r))}function tL(e){let{disableRemove:t,disableAlpha:n,gradientPickerDomRef:r,ignoreMarkerPosition:o,value:i,onChange:l,onStartControlPointChange:a,onStopControlPointChange:s,__experimentalIsRenderedInSidebar:c}=e;const u=(0,v.useRef)(),d=e=>{const t=JB(e.clientX,r.current),{initialPosition:n,index:o,significantMoveHappened:a}=u.current;!a&&Math.abs(n-t)>=5&&(u.current.significantMoveHappened=!0),l(YB(i,o,t))},p=()=>{window&&window.removeEventListener&&u.current&&u.current.listenersActivated&&(window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",p),s(),u.current.listenersActivated=!1)},m=(0,v.useRef)();return m.current=p,(0,v.useEffect)((()=>()=>{m.current()}),[]),i.map(((e,r)=>{const m=null==e?void 0:e.position;return o!==m&&(0,v.createElement)(eL,{isRenderedInSidebar:c,key:r,onClose:s,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,v.createElement)(QB,{key:r,onClick:()=>{u.current&&u.current.significantMoveHappened||(n?s():a(),o())},onMouseDown:()=>{window&&window.addEventListener&&(u.current={initialPosition:m,index:r,significantMoveHappened:!1,listenersActivated:!0},a(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",p))},onKeyDown:t=>{"ArrowLeft"===t.code?(t.stopPropagation(),l(YB(i,r,qB(e.position-10)))):"ArrowRight"===t.code&&(t.stopPropagation(),l(YB(i,r,qB(e.position+10))))},isOpen:n,position:e.position,color:e.color})},renderContent:o=>{let{onClose:a}=o;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(HN,{enableAlpha:!n,color:e.color,onChange:e=>{l(XB(i,r,(0,G.Vi)(e).toRgbString()))}}),!t&&i.length>2&&(0,v.createElement)(Bf.Z,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center"},(0,v.createElement)(Mo.ZP,{onClick:()=>{l(function(e,t){return e.filter(((e,n)=>n!==t))}(i,r)),a()},variant:"link"},(0,N.__)("Remove Control Point"))))},style:{left:`${e.position}%`,transform:"translateX( -50% )"}})}))}tL.InsertPoint=function(e){let{value:t,onChange:n,onOpenInserter:r,onCloseInserter:o,insertPosition:i,disableAlpha:l,__experimentalIsRenderedInSidebar:a}=e;const[s,c]=(0,v.useState)(!1);return(0,v.createElement)(eL,{isRenderedInSidebar:a,className:"components-custom-gradient-picker__inserter",onClose:()=>{o()},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,v.createElement)(Mo.ZP,{"aria-expanded":t,"aria-haspopup":"true",onClick:()=>{t?o():(c(!1),r()),n()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Tf.Z})},renderContent:()=>(0,v.createElement)(HN,{enableAlpha:!l,onChange:e=>{s?n(function(e,t,n){const r=e.findIndex((e=>e.position===t));return XB(e,r,n)}(t,i,(0,G.Vi)(e).toRgbString())):(n(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(t,i,(0,G.Vi)(e).toRgbString())),c(!0))}}),style:null!==i?{left:`${i}%`,transform:"translateX( -50% )"}:void 0})};var nL=tL;function rL(e,t){switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e}const oL={id:"IDLE"};function iL(e){let{background:t,hasGradient:n,value:r,onChange:o,disableInserter:i=!1,disableAlpha:l=!1,__experimentalIsRenderedInSidebar:a}=e;const s=(0,v.useRef)(),[c,u]=(0,v.useReducer)(rL,oL),d=e=>{const t=JB(e.clientX,s.current);r.some((e=>{let{position:n}=e;return Math.abs(t-n)<10}))?"MOVING_INSERTER"===c.id&&u({type:"STOP_INSERTER_MOVE"}):u({type:"MOVE_INSERTER",insertPosition:t})},p="MOVING_INSERTER"===c.id,m="INSERTING_CONTROL_POINT"===c.id;return(0,v.createElement)("div",{className:w()("components-custom-gradient-picker__gradient-bar",{"has-gradient":n}),onMouseEnter:d,onMouseMove:d,style:{background:t},onMouseLeave:()=>{u({type:"STOP_INSERTER_MOVE"})}},(0,v.createElement)("div",{ref:s,className:"components-custom-gradient-picker__markers-container"},!i&&(p||m)&&(0,v.createElement)(nL.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:l,insertPosition:c.insertPosition,value:r,onChange:o,onOpenInserter:()=>{u({type:"OPEN_INSERTER"})},onCloseInserter:()=>{u({type:"CLOSE_INSERTER"})}}),(0,v.createElement)(nL,{__experimentalIsRenderedInSidebar:a,disableAlpha:l,disableRemove:i,gradientPickerDomRef:s,ignoreMarkerPosition:m?c.insertPosition:void 0,value:r,onChange:o,onStartControlPointChange:()=>{u({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{u({type:"STOP_CONTROL_CHANGE"})}})))}var lL=n(49963);const aL="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",sL={type:"angular",value:90},cL=[{value:"linear-gradient",label:(0,N.__)("Linear")},{value:"radial-gradient",label:(0,N.__)("Radial")}],uL={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function dL(e){let{type:t,value:n,length:r}=e;return`${function(e){let{type:t,value:n}=e;return"literal"===t?n:"hex"===t?`#${n}`:`${t}(${n.join(",")})`}({type:t,value:n})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(r)}`}function pL(e){let{type:t,orientation:n,colorStops:r}=e;const o=function(e){if(e&&"angular"===e.type)return`${e.value}deg`}(n);return`${t}(${[o,...r.sort(((e,t)=>{var n,r,o,i;return(null!==(n=null==e||null===(r=e.length)||void 0===r?void 0:r.value)&&void 0!==n?n:0)-(null!==(o=null==t||null===(i=t.length)||void 0===i?void 0:i.value)&&void 0!==o?o:0)})).map(dL)].filter(Boolean).join(",")})`}function mL(e){return void 0===e.length||"%"!==e.length.type}function fL(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,G.l7)([q.Z]);const hL=(0,Ju.Z)(Lx.Z,{target:"e99xvul1"})({name:"1gvx10y",styles:"flex-grow:5"}),gL=(0,Ju.Z)(Lx.Z,{target:"e99xvul0"})({name:"1gvx10y",styles:"flex-grow:5"}),vL=e=>{var t,n;let{gradientAST:r,hasGradient:o,onChange:i}=e;const l=null!==(t=null==r||null===(n=r.orientation)||void 0===n?void 0:n.value)&&void 0!==t?t:180;return(0,v.createElement)(GB,{__nextHasNoMarginBottom:!0,onChange:e=>{i(pL({...r,orientation:{type:"angular",value:e}}))},value:o?l:""})},bL=e=>{let{gradientAST:t,hasGradient:n,onChange:r}=e;const{type:o}=t;return(0,v.createElement)(BT.Z,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,N.__)("Type"),labelPosition:"top",onChange:e=>{"linear-gradient"===e&&r(pL({...t,...t.orientation?{}:{orientation:sL},type:"linear-gradient"})),"radial-gradient"===e&&(()=>{const{orientation:e,...n}=t;r(pL({...n,type:"radial-gradient"}))})()},options:cL,size:"__unstable-large",value:n&&o})};function yL(e){let{__nextHasNoMargin:t=!1,value:n,onChange:r,__experimentalIsRenderedInSidebar:o}=e;const i=function(e){var t;let n;try{n=lL.parse(e)[0],n.value=e}catch(e){n=lL.parse(aL)[0],n.value=aL}if("directional"===(null===(t=n.orientation)||void 0===t?void 0:t.type)&&(n.orientation.type="angular",n.orientation.value=uL[n.orientation.value].toString()),n.colorStops.some(mL)){const{colorStops:e}=n,t=100/(e.length-1);e.forEach(((e,n)=>{e.length={value:t*n,type:"%"}})),n.value=pL(n)}return n}(n),l=function(e){return pL({type:"linear-gradient",orientation:sL,colorStops:e.colorStops})}(i),a=i.value!==aL,s=i.colorStops.map((e=>({color:fL(e),position:parseInt(e.length.value)})));return t||(0,St.default)("Outer margin styles for wp.components.CustomGradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,v.createElement)(sw.Z,{spacing:4,className:w()("components-custom-gradient-picker",{"is-next-has-no-margin":t})},(0,v.createElement)(iL,{__experimentalIsRenderedInSidebar:o,background:l,hasGradient:a,value:s,onChange:e=>{r(pL(function(e,t){return{...e,colorStops:t.map((e=>{let{position:t,color:n}=e;const{r:r,g:o,b:i,a:l}=(0,G.Vi)(n).toRgb();return{length:{type:"%",value:null==t?void 0:t.toString()},type:l<1?"rgba":"rgb",value:l<1?[r,o,i,l]:[r,o,i]}}))}}(i,e)))}}),(0,v.createElement)(Uu.Z,{gap:3,className:"components-custom-gradient-picker__ui-line"},(0,v.createElement)(hL,null,(0,v.createElement)(bL,{gradientAST:i,hasGradient:a,onChange:r})),(0,v.createElement)(gL,null,"linear-gradient"===i.type&&(0,v.createElement)(vL,{gradientAST:i,hasGradient:a,onChange:r}))))}function _L(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l}=e;const a=(0,v.useMemo)((()=>r.map(((e,t)=>{let{gradient:r,name:l}=e;return(0,v.createElement)(WN.Option,{key:r,value:r,isSelected:i===r,tooltipText:l||(0,N.sprintf)((0,N.__)("Gradient code: %s"),r),style:{color:"rgba( 0,0,0,0 )",background:r},onClick:i===r?n:()=>o(r,t),"aria-label":l?(0,N.sprintf)((0,N.__)("Gradient: %s"),l):(0,N.sprintf)((0,N.__)("Gradient code: %s"),r)})}))),[r,i,o,n]);return(0,v.createElement)(WN,{className:t,options:a,actions:l})}function kL(e){let{className:t,clearGradient:n,gradients:r,onChange:o,value:i,actions:l,headingLevel:a}=e;return(0,v.createElement)(sw.Z,{spacing:3,className:t},r.map(((e,t)=>{let{name:s,gradients:c}=e;return(0,v.createElement)(sw.Z,{spacing:2,key:t},(0,v.createElement)($N,{level:a},s),(0,v.createElement)(_L,(0,Po.Z)({clearGradient:n,gradients:c,onChange:e=>o(e,t),value:i},r.length===t+1?{actions:l}:{})))})))}function xL(e){let{__nextHasNoMargin:t=!1,className:n,gradients:r,onChange:o,value:i,clearable:l=!0,disableCustomGradients:a=!1,__experimentalIsRenderedInSidebar:s,headingLevel:c=2}=e;const u=(0,v.useCallback)((()=>o(void 0)),[o]),d=(p=r).length>0&&p.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}))?kL:_L;var p;t||(0,St.default)("Outer margin styles for wp.components.GradientPicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version"});const m=t?{}:{marginTop:null!=r&&r.length?void 0:3,marginBottom:l?0:6};return(0,v.createElement)(cw.Z,(0,Po.Z)({marginBottom:0},m),(0,v.createElement)(sw.Z,{spacing:null!=r&&r.length?4:0},!a&&(0,v.createElement)(yL,{__nextHasNoMargin:!0,__experimentalIsRenderedInSidebar:s,value:i,onChange:o}),((null==r?void 0:r.length)||l)&&(0,v.createElement)(d,{className:n,clearable:l,clearGradient:u,gradients:r,onChange:o,value:i,actions:l&&!a&&(0,v.createElement)(WN.ButtonAction,{onClick:u},(0,N.__)("Clear")),headingLevel:c})))}const wL=["colors","disableCustomColors","gradients","disableCustomGradients"],CL={name:"color",title:"Solid",value:"color"},EL={name:"gradient",title:"Gradient",value:"gradient"},SL=[CL,EL];function IL(e){let{colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,className:l,label:a,onColorChange:s,onGradientChange:c,colorValue:u,gradientValue:d,clearable:p,showTitle:m=!0,enableAlpha:f,headingLevel:h}=e;const g=s&&(!(0,U.isEmpty)(t)||!r),b=c&&(!(0,U.isEmpty)(n)||!o);if(!g&&!b)return null;const y={[CL.value]:(0,v.createElement)(QN,{value:u,onChange:b?e=>{s(e),c()}:s,colors:t,disableCustomColors:r,__experimentalIsRenderedInSidebar:i,clearable:p,enableAlpha:f,headingLevel:h}),[EL.value]:(0,v.createElement)(xL,{__nextHasNoMargin:!0,value:d,onChange:g?e=>{c(e),s()}:c,gradients:n,disableCustomGradients:o,__experimentalIsRenderedInSidebar:i,clearable:p,headingLevel:h})},_=e=>(0,v.createElement)("div",{className:"block-editor-color-gradient-control__panel"},y[e]);return(0,v.createElement)(Xu.ZP,{__nextHasNoMarginBottom:!0,className:w()("block-editor-color-gradient-control",l)},(0,v.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,v.createElement)(sw.Z,{spacing:1},m&&(0,v.createElement)("legend",null,(0,v.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,v.createElement)(Xu.ZP.VisualLabel,null,a))),g&&b&&(0,v.createElement)(cC.Z,{className:"block-editor-color-gradient-control__tabs",tabs:SL,initialTabName:d?EL.value:!!g&&CL.value},(e=>_(e.value))),!b&&_(CL.value),!g&&_(EL.value))))}function TL(e){const t={};return t.colors=bp("color.palette"),t.gradients=bp("color.gradients"),t.disableCustomColors=!bp("color.custom"),t.disableCustomGradients=!bp("color.customGradient"),(0,v.createElement)(IL,(0,Po.Z)({},t,e))}var NL=function(e){return wL.every((t=>e.hasOwnProperty(t)))?(0,v.createElement)(IL,e):(0,v.createElement)(TL,e)};const BL=e=>{let{setting:t,children:n,panelId:r,...o}=e;return(0,v.createElement)(nT,(0,Po.Z)({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},o,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:r,resetAllFilter:t.resetAllFilter}),n)},LL=e=>{let{colorValue:t,label:n}=e;return(0,v.createElement)(Bf.Z,{justify:"flex-start"},(0,v.createElement)(NT,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,v.createElement)(Gu.Z,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},PL=e=>t=>{let{onToggle:n,isOpen:r}=t;const{colorValue:o,label:i}=e,l={onClick:n,className:w()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r};return(0,v.createElement)(Mo.ZP,l,(0,v.createElement)(LL,{colorValue:o,label:i}))};function AL(e){let t,{colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradients:l,settings:a,__experimentalIsRenderedInSidebar:s,...c}=e;return s&&(t={placement:"left-start",offset:36,shift:!0}),(0,v.createElement)(v.Fragment,null,a.map(((e,a)=>{var u;const d={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:r,disableCustomGradients:o,enableAlpha:i,gradientValue:e.gradientValue,gradients:l,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...e},p={colorValue:null!==(u=e.gradientValue)&&void 0!==u?u:e.colorValue,label:e.label};return e&&(0,v.createElement)(BL,(0,Po.Z)({key:a,setting:e},c),(0,v.createElement)(t_.Z,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:PL(p),renderContent:()=>(0,v.createElement)(GN,{paddingSize:"none"},(0,v.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,v.createElement)(NL,d)))}))})))}var DL=n(67172);(0,G.l7)([q.Z,K.Z]);var RL=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:r,fallbackLinkColor:o,fontSize:i,isLargeText:l,textColor:a,linkColor:s,enableAlphaChecker:c=!1}=e;const u=t||n;if(!u)return null;const d=a||r,p=s||o;if(!d&&!p)return null;const m=[{color:d,description:(0,N.__)("text color")},{color:p,description:(0,N.__)("link color")}],f=(0,G.Vi)(u),h=f.alpha()<1,g=f.brightness(),b={level:"AA",size:l||!1!==l&&i>=24?"large":"small"};let y="",_="";for(const e of m){if(!e.color)continue;const t=(0,G.Vi)(e.color),n=t.isReadable(f,b),r=t.alpha()<1;if(!n){if(h||r)continue;y=gnull==e?void 0:e.colorValue));(0,v.useEffect)((()=>{var e;if(!o)return;if(!p.length)return i&&l(),a&&s(),void(c&&s());if(!d.current)return;s(ML(d.current).color);const t=null===(e=d.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&u(ML(t).color);let n=d.current,r=ML(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,r=ML(n).backgroundColor;l(r)}));const m=IB();return(0,v.createElement)(nh,{group:"color"},(0,v.createElement)(AL,(0,Po.Z)({enableAlpha:t,panelId:r,settings:n,__experimentalIsItemGroup:!1,__experimentalIsRenderedInSidebar:!0},m)),o&&(0,v.createElement)(RL,{backgroundColor:i,textColor:a,enableAlphaChecker:t,linkColor:c}))}const ZL="color",FL=e=>{const t=fe(e,ZL);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jL=e=>{if("web"!==ci.Z.OS)return!1;const t=fe(e,ZL);return null!==t&&"object"==typeof t&&!!t.link},zL=e=>{const t=fe(e,ZL);return null!==t&&"object"==typeof t&&!!t.gradients},HL=e=>{const t=fe(e,ZL);return t&&!1!==t.background},VL=e=>{const t=fe(e,ZL);return t&&!1!==t.text},WL=(e,t)=>yp(kp(t,e,void 0)),$L=e=>({textColor:void 0,style:WL(["color","text"],e.style)}),UL=e=>({style:WL(["elements","link","color","text"],e.style)}),GL=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function qL(e,t,n){var r,o,i,l,a,s;if(!FL(t)||wp(t,ZL))return e;const c=zL(t),{backgroundColor:u,textColor:d,gradient:p,style:m}=n,f=e=>!wp(t,ZL,e),h=f("text")?SB("color",d):void 0,g=f("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(p):void 0,v=f("background")?SB("background-color",u):void 0,b=f("background")||f("gradients"),y=u||(null==m||null===(r=m.color)||void 0===r?void 0:r.background)||c&&(p||(null==m||null===(o=m.color)||void 0===o?void 0:o.gradient)),_=w()(e.className,h,g,{[v]:!(c&&null!=m&&null!==(i=m.color)&&void 0!==i&&i.gradient||!v),"has-text-color":f("text")&&(d||(null==m||null===(l=m.color)||void 0===l?void 0:l.text)),"has-background":b&&y,"has-link-color":f("link")&&(null==m||null===(a=m.elements)||void 0===a||null===(s=a.link)||void 0===s?void 0:s.color)});return e.className=_||void 0,e}const KL=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?CB(e,n[1]).color:t};function YL(e){var t,n,r,o,i,l;const{name:a,attributes:s}=e,c=bp("color.palette.custom"),u=bp("color.palette.theme"),d=bp("color.palette.default"),p=(0,v.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]),m=bp("color.gradients.custom"),f=bp("color.gradients.theme"),h=bp("color.gradients.default"),g=(0,v.useMemo)((()=>[...m||[],...f||[],...h||[]]),[m,f,h]),b=bp("color.custom"),y=bp("color.customGradient"),_=bp("color.background"),k=bp("color.link"),x=bp("color.text"),w=b||!u||(null==u?void 0:u.length)>0,C=y||!f||(null==f?void 0:f.length)>0,E=(0,v.useRef)(s);if((0,v.useEffect)((()=>{E.current=s}),[s]),!FL(a))return null;const S=jL(a)&&k&&w,I=VL(a)&&x&&w,T=HL(a)&&_&&w,B=zL(a)&&C;if(!(S||I||T||B))return null;const{style:L,textColor:P,backgroundColor:A,gradient:D}=s;let R;if(B&&D)R=function(e,t){const n=null==e?void 0:e.find((e=>e.slug===t));return n&&n.gradient}(g,D);else if(B){var M;R=null==L||null===(M=L.color)||void 0===M?void 0:M.gradient}const O=t=>n=>{var r,o;const i=EB(p,n),l=t+"Color",a={...E.current.style,color:{...null===(r=E.current)||void 0===r||null===(o=r.style)||void 0===o?void 0:o.color,[t]:null!=i&&i.slug?void 0:n}},s=null!=i&&i.slug?i.slug:void 0,c={style:yp(a),[l]:s};e.setAttributes(c),E.current={...E.current,...c}},Z=fe(e.name,[ZL,"__experimentalDefaultControls"]),F="web"===ci.Z.OS&&!D&&!(null!=L&&null!==(t=L.color)&&void 0!==t&&t.gradient)&&T&&(S||I)&&!1!==fe(e.name,[ZL,"enableContrastChecker"]);return(0,v.createElement)(OL,{enableContrastChecking:F,clientId:e.clientId,enableAlpha:!0,settings:[...I?[{label:(0,N.__)("Text"),onColorChange:O("text"),colorValue:CB(p,P,null==L||null===(n=L.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==Z?void 0:Z.text,resetAllFilter:$L}]:[],...T||B?[{label:(0,N.__)("Background"),onColorChange:T?O("background"):void 0,colorValue:CB(p,A,null==L||null===(r=L.color)||void 0===r?void 0:r.background).color,gradientValue:R,onGradientChange:B?t=>{const n=function(e,t){const n=function(e,t){const n=null==e?void 0:e.find((e=>e.gradient===t));return n}(e,t);return n&&n.slug}(g,t);let r;if(n){var o,i,l;const e={...null===(o=E.current)||void 0===o?void 0:o.style,color:{...null===(i=E.current)||void 0===i||null===(l=i.style)||void 0===l?void 0:l.color,gradient:void 0}};r={style:yp(e),gradient:n}}else{var a,s,c;const e={...null===(a=E.current)||void 0===a?void 0:a.style,color:{...null===(s=E.current)||void 0===s||null===(c=s.style)||void 0===c?void 0:c.color,gradient:t}};r={style:yp(e),gradient:void 0}}e.setAttributes(r),E.current={...E.current,...r}}:void 0,isShownByDefault:null==Z?void 0:Z.background,resetAllFilter:GL}]:[],...S?[{label:(0,N.__)("Link"),onColorChange:t=>{var n;const r=EB(p,t),o=null!=r&&r.slug?`var:preset|color|${r.slug}`:t,i=yp(kp(null===(n=E.current)||void 0===n?void 0:n.style,["elements","link","color","text"],o));e.setAttributes({style:i}),E.current={...E.current,style:i}},colorValue:KL(p,null==L||null===(o=L.elements)||void 0===o||null===(i=o.link)||void 0===i||null===(l=i.color)||void 0===l?void 0:l.text),isShownByDefault:null==Z?void 0:Z.link,resetAllFilter:UL}]:[]]})}const XL=(0,Ao.o)((e=>t=>{var n;const{name:r,attributes:o}=t,{backgroundColor:i,textColor:l}=o,a=bp("color.palette.custom"),s=bp("color.palette.theme"),c=bp("color.palette.default"),u=(0,v.useMemo)((()=>[...a||[],...s||[],...c||[]]),[a,s,c]);if(!FL(r)||wp(r,ZL))return(0,v.createElement)(e,t);const d={};var p,m;l&&!wp(r,ZL,"text")&&(d.color=null===(p=CB(u,l))||void 0===p?void 0:p.color),i&&!wp(r,ZL,"background")&&(d.backgroundColor=null===(m=CB(u,i))||void 0===m?void 0:m.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...d,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,v.createElement)(e,(0,Po.Z)({},t,{wrapperProps:f}))})),JL={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,_e.KJ)("blocks.registerBlockType","core/color/addAttribute",(function(e){return FL(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),zL(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/color/addSaveProps",qL),(0,_e.KJ)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!FL(e)||wp(e,ZL))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),qL(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/color/with-color-palette-styles",XL),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return xp({linkColor:jL(o),textColor:VL(o),backgroundColor:HL(o),gradient:zL(o)},JL,e,t,n,r)}));var QL=n(92494);function eP(e){const[t,...n]=e;if(!t)return null;const[,r]=Hp(t.size),o=n.every((e=>{const[,t]=Hp(e.size);return t===r}));return o?r:null}const tP=(0,Ju.Z)("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),nP=(0,Ju.Z)(Xu.ZP.VisualLabel,{target:"e8tqeku3"})("display:flex;gap:",(0,Kp.D)(1),";justify-content:flex-start;margin-bottom:0;"),rP=(0,Ju.Z)("span",{target:"e8tqeku2"})("color:",ed.D.gray[700],";"),oP=(0,Ju.Z)("div",{target:"e8tqeku1"})((e=>!e.__nextHasNoMarginBottom&&`margin-bottom: ${(0,Kp.D)(6)};`),";"),iP=(0,Ju.Z)(Mo.ZP,{target:"e8tqeku0"})("&&&{height:",(e=>"__unstable-large"===e.size?"40px":"30px"),";}"),lP={key:"default",name:(0,N.__)("Default"),value:void 0},aP={key:"custom",name:(0,N.__)("Custom")};var sP=e=>{var t;const{fontSizes:n,value:r,disableCustomFontSizes:o,size:i,onChange:l,onSelectCustom:a}=e,s=!!eP(n),c=[lP,...n.map((e=>{let t;if(s){const[n]=Hp(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...o?[]:[aP]],u=r?null!==(t=c.find((e=>e.value===r)))&&void 0!==t?t:aP:lP;return(0,v.createElement)(zS,{__nextUnconstrainedWidth:!0,className:"components-font-size-picker__select",label:(0,N.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,N.sprintf)((0,N.__)("Currently selected font size: %s"),u.name),options:c,value:u,__experimentalShowSelectedHint:!0,onChange:e=>{let{selectedItem:t}=e;t===aP?a():l(t.value)},size:i})},cP=(0,v.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,v.createElement)(Md,(0,Po.Z)({},r,{"aria-label":o,ref:t}),n)}));const uP=[(0,N.__)("S"),(0,N.__)("M"),(0,N.__)("L"),(0,N.__)("XL"),(0,N.__)("XXL")],dP=[(0,N.__)("Small"),(0,N.__)("Medium"),(0,N.__)("Large"),(0,N.__)("Extra Large"),(0,N.__)("Extra Extra Large")];var pP=e=>{const{fontSizes:t,value:n,__nextHasNoMarginBottom:r,size:o,onChange:i}=e;return(0,v.createElement)(xd,{__nextHasNoMarginBottom:r,label:(0,N.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o},t.map(((e,t)=>(0,v.createElement)(cP,{key:e.slug,value:e.size,label:uP[t],"aria-label":e.name||dP[t],showTooltip:!0}))))};const mP=(0,v.forwardRef)(((e,t)=>{var n;const{__nextHasNoMarginBottom:r=!1,fallbackFontSize:o,fontSizes:i=[],disableCustomFontSizes:l=!1,onChange:a,size:s="default",value:c,withSlider:u=!1,withReset:d=!0}=e;r||(0,St.default)("Bottom margin styles for wp.components.FontSizePicker",{since:"6.1",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."});const p=Wp({availableUnits:["px","em","rem"]}),m=i.length>5,f=i.find((e=>e.size===c)),h=!!c&&!f,[g,b]=(0,v.useState)(!l&&h),y=(0,v.useMemo)((()=>{if(g)return(0,N.__)("Custom");if(!m)return f?f.name||dP[i.indexOf(f)]:"";const e=eP(i);return e?`(${e})`:""}),[g,m,f,i]);if(0===i.length&&l)return null;const _="string"==typeof c||"string"==typeof(null===(n=i[0])||void 0===n?void 0:n.size),[k,x]=Hp(c,p),w=!!x&&["em","rem"].includes(x);return(0,v.createElement)(tP,{ref:t,className:"components-font-size-picker"},(0,v.createElement)(n_.Z,{as:"legend"},(0,N.__)("Font size")),(0,v.createElement)(cw.Z,null,(0,v.createElement)(Bf.Z,{className:"components-font-size-picker__header"},(0,v.createElement)(nP,{"aria-label":`${(0,N.__)("Size")} ${y||""}`},(0,N.__)("Size"),y&&(0,v.createElement)(rP,{className:"components-font-size-picker__header__hint"},y)),!l&&(0,v.createElement)(Mo.ZP,{label:g?(0,N.__)("Use size preset"):(0,N.__)("Set custom size"),icon:QL.Z,onClick:()=>{b(!g)},isPressed:g,isSmall:!0}))),(0,v.createElement)(oP,{className:"components-font-size-picker__controls",__nextHasNoMarginBottom:r},!!i.length&&m&&!g&&(0,v.createElement)(sP,{fontSizes:i,value:c,disableCustomFontSizes:l,size:s,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:Number(e),i.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),!m&&!g&&(0,v.createElement)(pP,{fontSizes:i,value:c,__nextHasNoMarginBottom:r,size:s,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:Number(e),i.find((t=>t.size===e)))}}),!l&&g&&(0,v.createElement)(Uu.Z,{className:"components-font-size-picker__custom-size-control"},(0,v.createElement)(Gu.Z,{isBlock:!0},(0,v.createElement)(rm,{label:(0,N.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{void 0===e?null==a||a(void 0):null==a||a(_?e:parseInt(e,10))},size:s,units:_?p:[],min:0})),u&&(0,v.createElement)(Gu.Z,{isBlock:!0},(0,v.createElement)(cw.Z,{marginX:2,marginBottom:0},(0,v.createElement)(iN,{__nextHasNoMarginBottom:r,className:"components-font-size-picker__custom-input",label:(0,N.__)("Custom Size"),hideLabelFromVision:!0,value:k,initialPosition:o,withInputField:!1,onChange:e=>{void 0===e?null==a||a(void 0):_?null==a||a(e+(null!=x?x:"px")):null==a||a(e)},min:0,max:w?10:100,step:w?.1:1}))),d&&(0,v.createElement)(Gu.Z,null,(0,v.createElement)(iP,{disabled:void 0===c,onClick:()=>{null==a||a(void 0)},isSmall:!0,variant:"secondary",size:s},(0,N.__)("Reset"))))))}));var fP=mP;function hP(e){let{value:t="",onChange:n,fontFamilies:r,...o}=e;const i=bp("typography.fontFamilies");if(r||(r=i),!r||0===r.length)return null;const l=[{value:"",label:(0,N.__)("Default")},...r.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,v.createElement)(BT.Z,(0,Po.Z)({label:(0,N.__)("Font"),options:l,value:t,onChange:n,labelPosition:"top"},o))}const gP=[{name:(0,N._x)("Regular","font style"),value:"normal"},{name:(0,N._x)("Italic","font style"),value:"italic"}],vP=[{name:(0,N._x)("Thin","font weight"),value:"100"},{name:(0,N._x)("Extra Light","font weight"),value:"200"},{name:(0,N._x)("Light","font weight"),value:"300"},{name:(0,N._x)("Regular","font weight"),value:"400"},{name:(0,N._x)("Medium","font weight"),value:"500"},{name:(0,N._x)("Semi Bold","font weight"),value:"600"},{name:(0,N._x)("Bold","font weight"),value:"700"},{name:(0,N._x)("Extra Bold","font weight"),value:"800"},{name:(0,N._x)("Black","font weight"),value:"900"}];function bP(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...l}=e,a=n||r,s=((e,t)=>e?t?(0,N.__)("Appearance"):(0,N.__)("Font style"):(0,N.__)("Font weight"))(n,r),c={key:"default",name:(0,N.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,v.useMemo)((()=>n&&r?(()=>{const e=[c];return gP.forEach((t=>{let{name:n,value:r}=t;vP.forEach((t=>{let{name:o,value:i}=t;const l="normal"===r?o:(0,N.sprintf)((0,N.__)("%1$s %2$s"),o,n);e.push({key:`${r}-${i}`,name:l,style:{fontStyle:r,fontWeight:i}})}))})),e})():n?(()=>{const e=[c];return gP.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:r,fontWeight:void 0}})})),e})():(()=>{const e=[c];return vP.forEach((t=>{let{name:n,value:r}=t;e.push({key:r,name:n,style:{fontStyle:void 0,fontWeight:r}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return a&&(0,v.createElement)(HS,(0,Po.Z)({},l,{className:"components-font-appearance-control",label:s,describedBy:d?n?r?(0,N.sprintf)((0,N.__)("Currently selected font appearance: %s"),d.name):(0,N.sprintf)((0,N.__)("Currently selected font style: %s"),d.name):(0,N.sprintf)((0,N.__)("Currently selected font weight: %s"),d.name):(0,N.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}var yP=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:r=!1,__unstableInputWidth:o="60px",...i}=e;const l=function(e){return void 0!==e&&""!==e}(t),a=l?t:"";r||(0,St.default)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const s=r?void 0:{marginBottom:24};return(0,v.createElement)("div",{className:"block-editor-line-height-control",style:s},(0,v.createElement)(Gp.Z,(0,Po.Z)({},i,{__unstableInputWidth:o,__unstableStateReducer:(e,t)=>{var n;const r=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),o=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,r);return{...e,value:o}},onChange:n,label:(0,N.__)("Line height"),placeholder:1.5,step:.1,value:a,min:0,spinControls:"custom"})))};function _P(e){let{value:t,onChange:n,__unstableInputWidth:r="60px",...o}=e;const i=Wp({availableUnits:bp("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,v.createElement)(rm,(0,Po.Z)({},o,{label:(0,N.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:i,onChange:n}))}var kP=n(88615),xP=n(34709),wP=n(18808),CP=n(86798);const EP=[{name:(0,N.__)("None"),value:"none",icon:kP.Z},{name:(0,N.__)("Uppercase"),value:"uppercase",icon:xP.Z},{name:(0,N.__)("Lowercase"),value:"lowercase",icon:wP.Z},{name:(0,N.__)("Capitalize"),value:"capitalize",icon:CP.Z}];function SP(e){let{className:t,value:n,onChange:r}=e;return(0,v.createElement)("fieldset",{className:w()("block-editor-text-transform-control",t)},(0,v.createElement)(Xu.ZP.VisualLabel,{as:"legend"},(0,N.__)("Letter case")),(0,v.createElement)("div",{className:"block-editor-text-transform-control__buttons"},EP.map((e=>(0,v.createElement)(Mo.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===n,onClick:()=>{r(e.value===n?void 0:e.value)}})))))}var IP=n(87995),TP=n(88025);const NP=[{name:(0,N.__)("None"),value:"none",icon:kP.Z},{name:(0,N.__)("Underline"),value:"underline",icon:IP.Z},{name:(0,N.__)("Strikethrough"),value:"line-through",icon:TP.Z}];function BP(e){let{value:t,onChange:n,className:r}=e;return(0,v.createElement)("fieldset",{className:w()("block-editor-text-decoration-control",r)},(0,v.createElement)(Xu.ZP.VisualLabel,{as:"legend"},(0,N.__)("Decoration")),(0,v.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},NP.map((e=>(0,v.createElement)(Mo.ZP,{key:e.value,icon:e.icon,label:e.name,isPressed:e.value===t,onClick:()=>{n(e.value===t?void 0:e.value)}})))))}const LP="1600px",PP="768px",AP=1,DP=.75;function RP(e){let{minimumFontSize:t,maximumFontSize:n,fontSize:r,minimumViewPortWidth:o=PP,maximumViewPortWidth:i=LP,scaleFactor:l=AP,minimumFontSizeFactor:a=DP,minimumFontSizeLimit:s}=e;if(s=MP(s)?s:"14px",r){const e=MP(r);if(null==e||!e.unit)return null;const o=MP(s,{coerceTo:e.unit});if(null!=o&&o.value&&!t&&!n&&(null==e?void 0:e.value)<=(null==o?void 0:o.value))return null;if(n||(n=`${e.value}${e.unit}`),!t){const n=OP(e.value*a,3);t=null!=o&&o.value&&n<(null==o?void 0:o.value)?`${o.value}${o.unit}`:`${n}${e.unit}`}}const c=MP(t),u=(null==c?void 0:c.unit)||"rem",d=MP(n,{coerceTo:u});if(!c||!d)return null;const p=MP(t,{coerceTo:"rem"}),m=MP(i,{coerceTo:u}),f=MP(o,{coerceTo:u});if(!m||!f||!p)return null;const h=OP(f.value/100,3),g=OP(h,3)+u,v=OP(((d.value-c.value)/(m.value-f.value)*100||1)*l,3);return`clamp(${t}, ${p.value}${p.unit} + ((1vw - ${g}) * ${v}), ${n})`}function MP(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=null==o?void 0:o.join("|"),l=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(l);if(!a||a.length<3)return null;let[,s,c]=a,u=parseFloat(s);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:OP(u,3),unit:c}}function OP(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}const ZP=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:e=>{let{slug:t}=e;return`url( '#wp-duotone-${t}' )`},classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>{let{typography:n}=t;return function(e,t){var n,r;const{size:o}=e;if(!o||"0"===o)return o;if(null==t||!t.fluid||"object"==typeof(null==t?void 0:t.fluid)&&0===Object.keys(t.fluid).length)return o;if(!1===(null==e?void 0:e.fluid))return o;const i="object"==typeof(null==t?void 0:t.fluid)?null==t?void 0:t.fluid:{};return RP({minimumFontSize:null==e||null===(n=e.fluid)||void 0===n?void 0:n.min,maximumFontSize:null==e||null===(r=e.fluid)||void 0===r?void 0:r.max,fontSize:o,minimumFontSizeLimit:null==i?void 0:i.minFontSize})||o}(e,n)},valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:e=>{let{size:t}=e;return t},classes:[]}];function FP(e,t,n,r,o){const i=[(0,U.get)(e,["blocks",t,...n]),(0,U.get)(e,n)];for(const l of i)if(l){const i=["custom","theme","default"];for(const a of i){const i=l[a];if(i){const l=i.find((e=>e[r]===o));if(l)return"slug"===r||FP(e,t,n,"slug",l.slug)[r]===l[r]?l:void 0}}}}function jP(e,t,n){if(!n||"string"!=typeof n){var r,o;if(null===(r=n)||void 0===r||!r.ref||"string"!=typeof(null===(o=n)||void 0===o?void 0:o.ref))return n;{var i;const t=n.ref.split(".");if(!(n=(0,U.get)(e,t))||null!==(i=n)&&void 0!==i&&i.ref)return n}}const l="var:",a="var(--wp--";let s;if(n.startsWith(l))s=n.slice(l.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;s=n.slice(a.length,-")".length).split("--")}const[c,...u]=s;return"preset"===c?function(e,t,n,r){let[o,i]=r;const l=ZP.find((e=>e.cssVarInfix===o));if(!l)return n;const a=FP(e.settings,t,l.path,"slug",i);if(a){const{valueKey:n}=l;return jP(e,t,a[n])}return n}(e,t,n,u):"custom"===c?function(e,t,n,r){var o;const i=null!==(o=(0,U.get)(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:(0,U.get)(e.settings,["custom",...r]);return i?jP(e,t,i):n}(e,t,n,u):n}function zP(e){var t,n,r,o,i;const l=!(null!=e&&null!==(t=e.typography)&&void 0!==t&&t.customFontSize),a=null!==(n=null==e||null===(r=e.typography)||void 0===r?void 0:r.fontSizes)&&void 0!==n?n:{},s=null!==(o=null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:null==a?void 0:a.theme)&&void 0!==o?o:a.default;return!(null==s||!s.length)||!l}function HP(e){var t,n,r;const o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontFamilies,i=null!==(n=null!==(r=null==o?void 0:o.custom)&&void 0!==r?r:null==o?void 0:o.theme)&&void 0!==n?n:null==o?void 0:o.default;return!(null==i||!i.length)}function VP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.lineHeight}function WP(e){var t,n;const r=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontStyle,o=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontWeight;return r||o}function $P(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.letterSpacing}function UP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textTransform}function GP(e){var t;return null==e||null===(t=e.typography)||void 0===t?void 0:t.textDecoration}function qP(e){let{resetAllFilter:t,onChange:n,value:r,panelId:o,children:i}=e;return(0,v.createElement)(Yf,{label:(0,N.__)("Typography"),resetAll:()=>{const e=t(r);n(e)},panelId:o},i)}const KP={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textTransform:!0,textDecoration:!0};function YP(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,f,h,g,b,y;let{as:_=qP,value:k,onChange:x,inheritedValue:w=k,settings:C,panelId:E,defaultControls:S=KP}=e;const I=e=>jP({settings:C},"",e),T=HP(C),B=null==C||null===(t=C.typography)||void 0===t?void 0:t.fontFamilies,L=null!==(n=null!==(r=null==B?void 0:B.custom)&&void 0!==r?r:null==B?void 0:B.theme)&&void 0!==n?n:null==B?void 0:B.default,P=I(null==w||null===(o=w.typography)||void 0===o?void 0:o.fontFamily),A=e=>{var t;const n=null==L||null===(t=L.find((t=>{let{fontFamily:n}=t;return n===e})))||void 0===t?void 0:t.slug;x({...k,typography:{...null==k?void 0:k.typography,fontFamily:n?`var:preset|font-family|${n}`:e}})},D=zP(C),R=!(null!=C&&null!==(i=C.typography)&&void 0!==i&&i.customFontSize),M=null!==(l=null==C||null===(a=C.typography)||void 0===a?void 0:a.fontSizes)&&void 0!==l?l:{},O=null!==(s=null!==(c=null==M?void 0:M.custom)&&void 0!==c?c:null==M?void 0:M.theme)&&void 0!==s?s:M.default,Z=I(null==w||null===(u=w.typography)||void 0===u?void 0:u.fontSize),F=(e,t)=>{const n=null!=t&&t.slug?`var:preset|font-size|${null==t?void 0:t.slug}`:e;x({...k,typography:{...null==k?void 0:k.typography,fontSize:n}})},j=WP(C),z=function(e){var t,n;const r=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontStyle,o=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontWeight;return r?o?(0,N.__)("Appearance"):(0,N.__)("Font style"):(0,N.__)("Font weight")}(C),H=null==C||null===(d=C.typography)||void 0===d?void 0:d.fontStyle,V=null==C||null===(p=C.typography)||void 0===p?void 0:p.fontWeight,W=I(null==w||null===(m=w.typography)||void 0===m?void 0:m.fontStyle),$=I(null==w||null===(f=w.typography)||void 0===f?void 0:f.fontWeight),U=e=>{let{fontStyle:t,fontWeight:n}=e;x({...k,typography:{...null==k?void 0:k.typography,fontStyle:t,fontWeight:n}})},G=VP(C),q=I(null==w||null===(h=w.typography)||void 0===h?void 0:h.lineHeight),K=e=>{x({...k,typography:{...null==k?void 0:k.typography,lineHeight:e}})},Y=$P(C),X=I(null==w||null===(g=w.typography)||void 0===g?void 0:g.letterSpacing),J=e=>{x({...k,typography:{...null==k?void 0:k.typography,letterSpacing:e}})},Q=UP(C),ee=I(null==w||null===(b=w.typography)||void 0===b?void 0:b.textTransform),te=e=>{x({...k,typography:{...null==k?void 0:k.typography,textTransform:e}})},ne=GP(C),re=I(null==w||null===(y=w.typography)||void 0===y?void 0:y.textDecoration),oe=e=>{x({...k,typography:{...null==k?void 0:k.typography,textDecoration:e}})},ie=(0,v.useCallback)((e=>({...e,typography:{}})),[]);return(0,v.createElement)(_,{resetAllFilter:ie,value:k,onChange:x,panelId:E},T&&(0,v.createElement)(nT,{label:(0,N.__)("Font family"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontFamily)},onDeselect:()=>A(void 0),isShownByDefault:S.fontFamily,panelId:E},(0,v.createElement)(hP,{fontFamilies:L,value:P,onChange:A,size:"__unstable-large",__nextHasNoMarginBottom:!0})),D&&(0,v.createElement)(nT,{label:(0,N.__)("Font size"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontSize)},onDeselect:()=>F(void 0),isShownByDefault:S.fontSize,panelId:E},(0,v.createElement)(fP,{value:Z,onChange:F,fontSizes:O,disableCustomFontSizes:R,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),j&&(0,v.createElement)(nT,{className:"single-column",label:z,hasValue:()=>{var e,t;return!(null==k||null===(e=k.typography)||void 0===e||!e.fontStyle)||!(null==k||null===(t=k.typography)||void 0===t||!t.fontWeight)},onDeselect:()=>{U({})},isShownByDefault:S.fontAppearance,panelId:E},(0,v.createElement)(bP,{value:{fontStyle:W,fontWeight:$},onChange:U,hasFontStyles:H,hasFontWeights:V,size:"__unstable-large",__nextHasNoMarginBottom:!0})),G&&(0,v.createElement)(nT,{className:"single-column",label:(0,N.__)("Line height"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.lineHeight)},onDeselect:()=>K(void 0),isShownByDefault:S.lineHeight,panelId:E},(0,v.createElement)(yP,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:q,onChange:K,size:"__unstable-large"})),Y&&(0,v.createElement)(nT,{className:"single-column",label:(0,N.__)("Letter spacing"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.letterSpacing)},onDeselect:()=>J(void 0),isShownByDefault:S.letterSpacing,panelId:E},(0,v.createElement)(_P,{value:X,onChange:J,size:"__unstable-large",__unstableInputWidth:"auto"})),ne&&(0,v.createElement)(nT,{className:"single-column",label:(0,N.__)("Text decoration"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.textDecoration)},onDeselect:()=>oe(void 0),isShownByDefault:S.textDecoration,panelId:E},(0,v.createElement)(BP,{value:re,onChange:oe,size:"__unstable-large",__unstableInputWidth:"auto"})),Q&&(0,v.createElement)(nT,{label:(0,N.__)("Letter case"),hasValue:()=>{var e;return!(null==k||null===(e=k.typography)||void 0===e||!e.textTransform)},onDeselect:()=>te(void 0),isShownByDefault:S.textTransform,panelId:E},(0,v.createElement)(SP,{value:ee,onChange:te,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})))}const XP="typography.__experimentalFontFamily";function JP(e,t,n){if(!he(t,XP))return e;if(wp(t,iA,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const r=new _E(e.className);r.add(`has-${(0,U.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}function QP(e){if(e)return`has-${(0,U.kebabCase)(e)}-font-size`}(0,_e.KJ)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return he(e,XP)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",JP),(0,_e.KJ)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!he(e,XP))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),JP(r,e,n)},e}));const eA="typography.fontSize";function tA(e,t,n){if(!he(t,eA))return e;if(wp(t,iA,"fontSize"))return e;const r=new _E(e.className);r.add(QP(n.fontSize));const o=r.value;return e.className=o||void 0,e}const nA=(0,Ao.o)((e=>t=>{var n,r;const o=bp("typography.fontSizes"),{name:i,attributes:{fontSize:l,style:a},wrapperProps:s}=t;if(!he(i,eA)||wp(i,iA,"fontSize")||!l||null!=a&&null!==(n=a.typography)&&void 0!==n&&n.fontSize)return(0,v.createElement)(e,t);const c=((e,t,n)=>{if(t){const n=null==e?void 0:e.find((e=>{let{slug:n}=e;return n===t}));if(n)return n}return{size:n}})(o,l,null==a||null===(r=a.typography)||void 0===r?void 0:r.fontSize).size,u={...t,wrapperProps:{...s,style:{fontSize:c,...null==s?void 0:s.style}}};return(0,v.createElement)(e,u)}),"withFontSizeInlineStyles"),rA={fontSize:[["fontSize"],["style","typography","fontSize"]]};function oA(e,t){return Object.fromEntries(Object.entries(e).filter((e=>{let[n]=e;return!t.includes(n)})))}(0,_e.KJ)("blocks.registerBlockType","core/font/addAttribute",(function(e){return he(e,eA)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/font/addSaveProps",tA),(0,_e.KJ)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!he(e,eA))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),tA(r,e,n)},e})),(0,_e.KJ)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",nA),(0,_e.KJ)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return xp({fontSize:he(e.name,eA)},rA,e,t,n,r)})),(0,_e.KJ)("blocks.registerBlockType","core/font-size/addEditPropsForFluidCustomFontSizes",(function(e){if(!he(e,eA)||wp(e,iA,"fontSize"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=e=>{var n,r,o;const i=t?t(e):{},l=null==i||null===(n=i.style)||void 0===n?void 0:n.fontSize,a=null===(r=(0,$.select)(ku).getSettings().__experimentalFeatures)||void 0===r||null===(o=r.typography)||void 0===o?void 0:o.fluid,s="object"==typeof a?a:{},c=l&&a?RP({fontSize:l,minimumFontSizeLimit:null==s?void 0:s.minFontSize}):null;return null===c?i:{...i,style:{...null==i?void 0:i.style,fontSize:c}}},e}),11);const iA="typography",lA=["typography.lineHeight",eA,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",XP,"typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function aA(e){var t,n;const r={...oA(e,["fontFamily"])},o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontSize,i=null==e||null===(n=e.typography)||void 0===n?void 0:n.fontFamily,l=null!=o&&o.startsWith("var:preset|font-size|")?o.substring("var:preset|font-size|".length):void 0,a=null!=i&&i.startsWith("var:preset|font-family|")?i.substring("var:preset|font-family|".length):void 0;return r.typography={...oA(r.typography,["fontFamily"]),fontSize:l?void 0:o},{style:yp(r),fontFamily:a,fontSize:l}}function sA(e){var t,n,r;return{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:null===(n=e.style)||void 0===n||null===(r=n.typography)||void 0===r?void 0:r.fontSize}}}function cA(e){let{children:t,resetAllFilter:n}=e;const r=(0,v.useCallback)((e=>{const t=sA(e),r=n(t);return{...e,...aA(r)}}),[n]);return(0,v.createElement)(nh,{group:"typography",resetAllFilter:r},t)}function uA(e){let{clientId:t,name:n,attributes:r,setAttributes:o,__unstableParentLayout:i}=e;const l=Cp(n,i),a=function(e){const t=HP(e),n=VP(e),r=WP(e),o=$P(e),i=UP(e),l=GP(e),a=zP(e);return t||n||r||o||i||a||l}(l),s=(0,v.useMemo)((()=>sA({style:r.style,fontFamily:r.fontFamily,fontSize:r.fontSize})),[r.style,r.fontSize,r.fontFamily]);if(!a)return null;const c=fe(n,[iA,"__experimentalDefaultControls"]);return(0,v.createElement)(YP,{as:cA,panelId:t,name:n,settings:l,value:s,onChange:e=>{o(aA(e))},defaultControls:c})}var dA=n(48234);const pA=(0,Ju.Z)("div",{target:"e1jovhle6"})({name:"14bvcyk",styles:"box-sizing:border-box;max-width:235px;padding-bottom:12px;width:100%"}),mA=(0,Ju.Z)(Uu.Z,{target:"e1jovhle5"})({name:"5bhc30",styles:"margin-bottom:8px"}),fA=(0,Ju.Z)(Uu.Z,{target:"e1jovhle4"})({name:"aujtid",styles:"min-height:30px;gap:0"}),hA=(0,Ju.Z)("div",{target:"e1jovhle3"})({name:"112jwab",styles:"box-sizing:border-box;max-width:80px"}),gA=(0,Ju.Z)(Uu.Z,{target:"e1jovhle2"})({name:"xy18ro",styles:"justify-content:center;padding-top:8px"}),vA=(0,Ju.Z)(Uu.Z,{target:"e1jovhle1"})({name:"3tw5wk",styles:"position:relative;height:100%;width:100%;justify-content:flex-start"});var bA={name:"1ch9yvl",styles:"border-radius:0"},yA={name:"tg3mx0",styles:"border-radius:2px"};const _A=e=>{let{isFirst:t,isLast:n,isOnly:r}=e;return t?(0,Up.b)({borderTopRightRadius:0,borderBottomRightRadius:0})():n?(0,Up.b)({borderTopLeftRadius:0,borderBottomLeftRadius:0})():r?yA:bA},kA=e=>{let{isFirst:t,isOnly:n}=e;const r=t||n?0:-1;return(0,Up.b)({marginLeft:r})()},xA=(0,Ju.Z)(rm,{target:"e1jovhle0"})("max-width:60px;",_A,";",kA,";"),wA=()=>{};function CA(e){let{isFirst:t,isLast:n,isOnly:r,onHoverOn:o=wA,onHoverOff:i=wA,label:l,value:a,...s}=e;const c=(0,dA.useHover)((e=>{let{event:t,...n}=e;n.hovering?o(t,n):i(t,n)}));return(0,v.createElement)(hA,c(),(0,v.createElement)(EA,{text:l},(0,v.createElement)(xA,(0,Po.Z)({"aria-label":l,className:"component-box-control__unit-control",isFirst:t,isLast:n,isOnly:r,isPressEnterToChange:!0,isResetValueOnUnitChange:!1,value:a},s))))}function EA(e){let{children:t,text:n}=e;return n?(0,v.createElement)(Ld.Z,{text:n,position:"top"},(0,v.createElement)("div",null,t)):t}const SA={all:(0,N.__)("All"),top:(0,N.__)("Top"),bottom:(0,N.__)("Bottom"),left:(0,N.__)("Left"),right:(0,N.__)("Right"),mixed:(0,N.__)("Mixed"),vertical:(0,N.__)("Vertical"),horizontal:(0,N.__)("Horizontal")},IA={top:void 0,right:void 0,bottom:void 0,left:void 0},TA=["top","right","bottom","left"];function NA(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function BA(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:TA;const r=RA(n),o=r.map((t=>Hp(e[t]))),i=o.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),l=o.map((e=>e[1])),a=i.every((e=>e===i[0]))?i[0]:"";let s;var c;return s="number"==typeof a?NA(l):null!==(c=LA(t))&&void 0!==c?c:NA(l),[a,s].join("")}function LA(e){if(e&&"object"==typeof e)return NA(Object.values(e).filter(Boolean))}function PA(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:TA;const r=BA(e,t,n),o=isNaN(parseFloat(r));return o}function AA(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function DA(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function RA(e){const t=[];if(null==e||!e.length)return TA;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=TA.filter((t=>e.includes(t)));t.push(...n)}return t}function MA(e,t,n){const r={...e};return null!=n&&n.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):TA.forEach((e=>r[e]=t)),r}const OA=()=>{};function ZA(e){let{onChange:t=OA,onFocus:n=OA,onHoverOn:r=OA,onHoverOff:o=OA,values:i,sides:l,selectedUnits:a,setSelectedUnits:s,...c}=e;const u=BA(i,a,l),d=AA(i)&&PA(i,a,l),p=d?SA.mixed:void 0;return(0,v.createElement)(CA,(0,Po.Z)({},c,{disableUnits:d,isOnly:!0,value:u,onChange:e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),r=MA(i,n?e:void 0,l);t(r)},onUnitChange:e=>{const t=MA(a,e,l);s(t)},onFocus:e=>{n(e,{side:"all"})},onHoverOn:()=>{r({top:!0,bottom:!0,left:!0,right:!0})},onHoverOff:()=>{o({top:!1,bottom:!1,left:!1,right:!1})},placeholder:p}))}const FA=()=>{};function jA(e){let{onChange:t=FA,onFocus:n=FA,onHoverOn:r=FA,onHoverOff:o=FA,values:i,selectedUnits:l,setSelectedUnits:a,sides:s,...c}=e;const u=e=>t=>{n(t,{side:e})},d=e=>()=>{r({[e]:!0})},p=e=>()=>{o({[e]:!1})},m=e=>(n,r)=>{let{event:o}=r;const l={...i},a=void 0===n||isNaN(parseFloat(n))?void 0:n;if(l[e]=a,o.altKey)switch(e){case"top":l.bottom=a;break;case"bottom":l.top=a;break;case"left":l.right=a;break;case"right":l.left=a}(e=>{t(e)})(l)},f=e=>t=>{const n={...l};n[e]=t,a(n)},h=null!=s&&s.length?TA.filter((e=>s.includes(e))):TA,g=h[0],b=h[h.length-1],y=g===b&&g;return(0,v.createElement)(gA,{className:"component-box-control__input-controls-wrapper"},(0,v.createElement)(vA,{gap:0,align:"top",className:"component-box-control__input-controls"},h.map((e=>{const[t,n]=Hp(i[e]),r=i[e]?n:l[e];return(0,v.createElement)(CA,(0,Po.Z)({},c,{isFirst:g===e,isLast:b===e,isOnly:y===e,value:[t,r].join(""),onChange:m(e),onUnitChange:f(e),onFocus:u(e),onHoverOn:d(e),onHoverOff:p(e),label:SA[e],key:`box-control-${e}`}))}))))}const zA=["vertical","horizontal"];function HA(e){let{onChange:t,onFocus:n,onHoverOn:r,onHoverOff:o,values:i,selectedUnits:l,setSelectedUnits:a,sides:s,...c}=e;const u=e=>t=>{n&&n(t,{side:e})},d=e=>()=>{r&&("vertical"===e&&r({top:!0,bottom:!0}),"horizontal"===e&&r({left:!0,right:!0}))},p=e=>()=>{o&&("vertical"===e&&o({top:!1,bottom:!1}),"horizontal"===e&&o({left:!1,right:!1}))},m=e=>n=>{if(!t)return;const r={...i},o=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},f=e=>t=>{const n={...l};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),a(n)},h=null!=s&&s.length?zA.filter((e=>s.includes(e))):zA,g=h[0],b=h[h.length-1],y=g===b&&g;return(0,v.createElement)(vA,{gap:0,align:"top",className:"component-box-control__vertical-horizontal-input-controls"},h.map((e=>{const[t,n]=Hp("vertical"===e?i.top:i.left),r="vertical"===e?l.top:l.left;return(0,v.createElement)(CA,(0,Po.Z)({},c,{isFirst:g===e,isLast:b===e,isOnly:y===e,value:[t,null!=r?r:n].join(""),onChange:m(e),onUnitChange:f(e),onFocus:u(e),onHoverOn:d(e),onHoverOff:p(e),label:SA[e],key:e}))})))}const VA=(0,Ju.Z)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),WA=(0,Ju.Z)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),$A=(0,Ju.Z)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",(e=>{let{isFocused:t}=e;return(0,Qu.iv)({backgroundColor:"currentColor",opacity:t?1:.3},"","")}),";"),UA=(0,Ju.Z)($A,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),GA=(0,Ju.Z)($A,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),qA=(0,Ju.Z)(GA,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),KA=(0,Ju.Z)(UA,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),YA=(0,Ju.Z)(GA,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),XA=(0,Ju.Z)(UA,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function JA(e){let{size:t=24,side:n="all",sides:r,...o}=e;const i=e=>!(e=>(null==r?void 0:r.length)&&!r.includes(e))(e)&&("all"===n||n===e),l=i("top")||i("vertical"),a=i("right")||i("horizontal"),s=i("bottom")||i("vertical"),c=i("left")||i("horizontal"),u=t/24;return(0,v.createElement)(VA,(0,Po.Z)({style:{transform:`scale(${u})`}},o),(0,v.createElement)(WA,null,(0,v.createElement)(qA,{isFocused:l}),(0,v.createElement)(KA,{isFocused:a}),(0,v.createElement)(YA,{isFocused:s}),(0,v.createElement)(XA,{isFocused:c})))}function QA(e){let{isLinked:t,...n}=e;const r=t?(0,N.__)("Unlink sides"):(0,N.__)("Link sides");return(0,v.createElement)(Ld.Z,{text:r},(0,v.createElement)(Mo.ZP,(0,Po.Z)({},n,{className:"component-box-control__linked-button",isSmall:!0,icon:t?rT.Z:oT.Z,iconSize:24,"aria-label":r})))}const eD={min:0},tD=()=>{};var nD=function e(t){let{id:n,inputProps:r=eD,onChange:o=tD,label:i=(0,N.__)("Box Control"),values:l,units:a,sides:s,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=IA,onMouseOver:p,onMouseOut:m}=t;const[f,h]=(0,tm.Z)(l,{fallback:IA}),g=f||IA,b=AA(l),y=1===(null==s?void 0:s.length),[_,k]=(0,v.useState)(b),[x,w]=(0,v.useState)(!b||!PA(g)||y),[C,E]=(0,v.useState)(DA(x,c)),[S,I]=(0,v.useState)({top:Hp(null==l?void 0:l.top)[1],right:Hp(null==l?void 0:l.right)[1],bottom:Hp(null==l?void 0:l.bottom)[1],left:Hp(null==l?void 0:l.left)[1]}),T=function(t){const n=(0,dd.Z)(e,"inspector-box-control");return t||n}(n),B=`${T}-heading`,L={...r,onChange:e=>{o(e),h(e),k(!0)},onFocus:(e,t)=>{let{side:n}=t;E(n)},isLinked:x,units:a,selectedUnits:S,setSelectedUnits:I,sides:s,values:g,onMouseOver:p,onMouseOut:m};return(0,v.createElement)(pA,{id:T,role:"group","aria-labelledby":B},(0,v.createElement)(mA,{className:"component-box-control__header"},(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Xu.Xp.VisualLabel,{id:B},i)),u&&(0,v.createElement)(Gu.Z,null,(0,v.createElement)(Mo.ZP,{className:"component-box-control__reset-button",variant:"secondary",isSmall:!0,onClick:()=>{o(d),h(d),I(d),k(!1)},disabled:!_},(0,N.__)("Reset")))),(0,v.createElement)(fA,{className:"component-box-control__header-control-wrapper"},(0,v.createElement)(Gu.Z,null,(0,v.createElement)(JA,{side:C,sides:s})),x&&(0,v.createElement)(Lx.Z,null,(0,v.createElement)(ZA,(0,Po.Z)({"aria-label":i},L))),!x&&c&&(0,v.createElement)(Lx.Z,null,(0,v.createElement)(HA,L)),!y&&(0,v.createElement)(Gu.Z,null,(0,v.createElement)(QA,{onClick:()=>{w(!x),E(DA(!x,c))},isLinked:x}))),!x&&!c&&(0,v.createElement)(jA,L))};const rD={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1}};function oD(e){var t,n,r,o,i;let{spacingSizes:l,value:a,side:s,onChange:c,isMixed:u=!1,type:d,minimumCustomValue:p,onMouseOver:m,onMouseOut:f}=e;a=function(e,t){if(Wd(e))return e;const n=t.find((t=>String(t.size)===String(e)));return null!=n&&n.slug?`var:preset|spacing|${n.slug}`:e}(a,l);let h=l;const g=l.length<=8,b=(0,E.Z)((e=>{const t=e(ku).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[y,_]=(0,v.useState)(!b&&void 0!==a&&!Wd(a)),k=Wp({availableUnits:bp("spacing.units")||["px","em","rem"]});let x=null;g||y||void 0===a||!(!Wd(a)||Wd(a)&&u)?u||(x=y?function(e,t){if(!Wd(e))return e;const n=Ud(e),r=t.find((e=>String(e.slug)===n));return null==r?void 0:r.size}(a,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":Ud(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(a,l)):(h=[...l,{name:u?(0,N.__)("Mixed"):(0,N.sprintf)((0,N.__)("Custom (%s)"),a),slug:"custom",size:a}],x=h.length-1);const C=(0,v.useMemo)((()=>Hp(x)),[x])[1]||k[0].value,S=e=>{var t;return void 0===a||null===(t=l[e])||void 0===t?void 0:t.name},I=parseFloat(x,10),T=(e,t)=>{var n;const r=parseInt(e,10);if("selectList"===t){if(0===r)return;if(1===r)return"0"}else if(0===r)return"0";return`var:preset|spacing|${null===(n=l[e])||void 0===n?void 0:n.slug}`},B=u?(0,N.__)("Mixed"):null,L=u?(0,N.__)("Mixed"):S(x),P=h.map(((e,t)=>({key:t,name:e.name}))),A=l.map(((e,t)=>({value:t,label:void 0}))),D=(0,N.sprintf)((0,N.__)("%1$s %2$s"),Gd[s],null==d?void 0:d.toLowerCase()),R=g&&!y&&void 0!==L;return(0,v.createElement)(v.Fragment,null,"all"!==s&&(0,v.createElement)(Bf.Z,{className:"components-spacing-sizes-control__side-labels"},(0,v.createElement)(Xu.ZP.VisualLabel,{className:"components-spacing-sizes-control__side-label"},Gd[s]),R&&(0,v.createElement)(Xu.ZP.VisualLabel,{className:"components-spacing-sizes-control__hint-single"},L)),"all"===s&&R&&(0,v.createElement)(Xu.ZP.VisualLabel,{className:"components-spacing-sizes-control__hint-all"},L),!b&&(0,v.createElement)(Mo.ZP,{label:y?(0,N.__)("Use size preset"):(0,N.__)("Set custom size"),icon:QL.Z,onClick:()=>{_(!y)},isPressed:y,isSmall:!0,className:w()({"components-spacing-sizes-control__custom-toggle-all":"all"===s,"components-spacing-sizes-control__custom-toggle-single":"all"!==s}),iconSize:24}),y&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(rm,{onMouseOver:m,onMouseOut:f,onFocus:m,onBlur:f,onChange:e=>c((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:x,units:k,min:p,placeholder:B,disableUnits:u,label:D,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input",size:"__unstable-large"}),(0,v.createElement)(iN,{onMouseOver:m,onMouseOut:f,onFocus:m,onBlur:f,value:I,min:0,max:null!==(t=null===(n=rD[C])||void 0===n?void 0:n.max)&&void 0!==t?t:10,step:null!==(r=null===(o=rD[C])||void 0===o?void 0:o.steps)&&void 0!==r?r:.1,withInputField:!1,onChange:e=>{c([e,C].join(""))},className:"components-spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})),g&&!y&&(0,v.createElement)(iN,{onMouseOver:m,onMouseOut:f,className:"components-spacing-sizes-control__range-control",value:x,onChange:e=>c(T(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===a&&c("0")},withInputField:!1,"aria-valuenow":x,"aria-valuetext":null===(i=l[x])||void 0===i?void 0:i.name,renderTooltipContent:S,min:0,max:l.length-1,marks:A,label:D,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:m,onBlur:f}),!g&&!y&&(0,v.createElement)(HS,{className:"components-spacing-sizes-control__custom-select-control",value:P.find((e=>e.key===x))||"",onChange:e=>{c(T(e.selectedItem.key,"selectList"))},options:P,label:D,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0,size:"__unstable-large",onMouseOver:m,onMouseOut:f,onFocus:m,onBlur:f}))}function iD(e){let{onChange:t,values:n,sides:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yd(Object.values(e))}(n),u=Jd(n)&&Xd(n,r);return(0,v.createElement)(oD,{value:c,onChange:e=>{const o=MA(n,e,r);t(o)},side:"all",spacingSizes:o,isMixed:u,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s})}function lD(e){let{values:t,sides:n,onChange:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=null!=n&&n.length?Kd.filter((e=>n.includes(e))):Kd,u=e=>n=>{const o={...t};o[e]=n,r(o)};return(0,v.createElement)(v.Fragment,null,c.map((e=>(0,v.createElement)(oD,{value:t[e],label:Gd[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:u(e),spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}))))}const aD=["vertical","horizontal"];function sD(e){let{onChange:t,values:n,sides:r,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s}=e;const c=e=>r=>{if(!t)return;const o={...n};"vertical"===e&&(o.top=r,o.bottom=r),"horizontal"===e&&(o.left=r,o.right=r),t(o)},u=null!=r&&r.length?aD.filter((e=>r.includes(e))):aD;return(0,v.createElement)(v.Fragment,null,u.map((e=>{const t="vertical"===e?n.top:n.left;return(0,v.createElement)(oD,{value:t,onChange:c(e),label:Gd[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:o,type:i,minimumCustomValue:l,onMouseOver:a,onMouseOut:s})})))}function cD(e){let{isLinked:t,onClick:n}=e;const r=t?(0,N.__)("Unlink sides"):(0,N.__)("Link sides");return(0,v.createElement)(Ld.Z,{text:r},(0,v.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,v.createElement)(Mo.ZP,{isSmall:!0,icon:t?rT.Z:oT.Z,iconSize:24,"aria-label":r,onClick:n})))}function uD(e){let{inputProps:t,onChange:n,label:r=(0,N.__)("Spacing Control"),values:o,sides:i,splitOnAxis:l=!1,useSelect:a,minimumCustomValue:s=0,onMouseOver:c,onMouseOut:u}=e;const d=[{name:0,slug:"0",size:0},...bp("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,N.__)("Default"),slug:"default",size:void 0});const p=o||qd,m=Jd(o),f=1===(null==i?void 0:i.length),[h,g]=(0,v.useState)(!m||!Xd(p,i)||f),b={...t,onChange:e=>{const t={...o,...e};n(t)},isLinked:h,sides:i,values:p,spacingSizes:d,useSelect:a,type:r,minimumCustomValue:s,onMouseOver:c,onMouseOut:u};return(0,v.createElement)("fieldset",{className:w()("component-spacing-sizes-control",{"is-unlinked":!h})},(0,v.createElement)(Xu.ZP.VisualLabel,{as:"legend"},r),!f&&(0,v.createElement)(cD,{onClick:()=>{g(!h)},isLinked:h}),h&&(0,v.createElement)(iD,(0,Po.Z)({"aria-label":r},b)),!h&&l&&(0,v.createElement)(sD,b),!h&&!l&&(0,v.createElement)(lD,b))}const dD={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1}};function pD(e){var t,n,r,o,i;let{label:l=(0,N.__)("Height"),onChange:a,value:s}=e;const c=parseFloat(s),u=Wp({availableUnits:bp("spacing.units")||["%","px","em","rem","vh","vw"]}),d=(0,v.useMemo)((()=>Hp(s)),[s])[1]||(null===(t=u[0])||void 0===t?void 0:t.value)||"px";return(0,v.createElement)("fieldset",{className:"block-editor-height-control"},(0,v.createElement)(Xu.ZP.VisualLabel,{as:"legend"},l),(0,v.createElement)(Uu.Z,null,(0,v.createElement)(Gu.Z,{isBlock:!0},(0,v.createElement)(rm,{value:s,units:u,onChange:a,onUnitChange:e=>{const[t,n]=Hp(s);["em","rem"].includes(e)&&"px"===n?a((t/16).toFixed(2)+e):["em","rem"].includes(n)&&"px"===e?a(Math.round(16*t)+e):["vh","vw","%"].includes(e)&&t>100&&a(100+e)},min:0,size:"__unstable-large"})),(0,v.createElement)(Gu.Z,{isBlock:!0},(0,v.createElement)(cw.Z,{marginX:2,marginBottom:0},(0,v.createElement)(iN,{value:c,min:0,max:null!==(n=null===(r=dD[d])||void 0===r?void 0:r.max)&&void 0!==n?n:100,step:null!==(o=null===(i=dD[d])||void 0===i?void 0:i.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{a([e,d].join(""))},__nextHasNoMarginBottom:!0})))))}function mD(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,N.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,N.__)("Specify a fixed width."):"fixed"===e?(0,N.__)("Specify a fixed height."):(0,N.__)("Fit contents.")}function fD(e){let{value:t={},onChange:n,parentLayout:r}=e;const{selfStretch:o,flexSize:i}=t;return(0,v.useEffect)((()=>{"fixed"!==o||i||n({...t,selfStretch:"fit"})}),[]),(0,v.createElement)(v.Fragment,null,(0,v.createElement)(xd,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:hD(r),value:o||"fit",help:mD(o,r),onChange:e=>{const r="fixed"!==e?null:i;n({...t,selfStretch:e,flexSize:r})},isBlock:!0},(0,v.createElement)(cP,{key:"fit",value:"fit",label:(0,N.__)("Fit")}),(0,v.createElement)(cP,{key:"fill",value:"fill",label:(0,N.__)("Fill")}),(0,v.createElement)(cP,{key:"fixed",value:"fixed",label:(0,N.__)("Fixed")})),"fixed"===o&&(0,v.createElement)(rm,{size:"__unstable-large",onChange:e=>{n({...t,flexSize:e})},value:i}))}function hD(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,N.__)("Width"):(0,N.__)("Height")}const gD=["horizontal","vertical"];function vD(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.contentSize}function bD(e){var t;return null==e||null===(t=e.layout)||void 0===t?void 0:t.wideSize}function yD(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.padding}function _D(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.margin}function kD(e){var t;return null==e||null===(t=e.spacing)||void 0===t?void 0:t.blockGap}function xD(e){var t;return null==e||null===(t=e.dimensions)||void 0===t?void 0:t.minHeight}function wD(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=null==e?void 0:e.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n)&&o;return!(null==e||!e.layout)&&i}function CD(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=null==e?void 0:e[t]})),n}function ED(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function SD(e){let{resetAllFilter:t,onChange:n,value:r,panelId:o,children:i}=e;return(0,v.createElement)(Yf,{label:(0,N.__)("Dimensions"),resetAll:()=>{const e=t(r);n(e)},panelId:o},i)}const ID={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0};function TD(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,f,h,g,b,y,_,k;let{as:x=SD,value:C,onChange:E,inheritedValue:S=C,settings:I,panelId:T,defaultControls:B=ID,onVisualize:L=(()=>{}),includeLayoutControls:P=!1}=e;const A=e=>jP({settings:I},"",e),D=function(e){var t,n,r;const{custom:o,theme:i,default:l}=(null==e||null===(t=e.spacing)||void 0===t?void 0:t.spacingSizes)||{};return(null!==(n=null!==(r=null!=o?o:i)&&void 0!==r?r:l)&&void 0!==n?n:[]).length>0}(I),R=Wp({availableUnits:(null==I||null===(t=I.spacing)||void 0===t?void 0:t.units)||["%","px","em","rem","vw"]}),M=vD(I)&&P,O=A(null==S||null===(n=S.layout)||void 0===n?void 0:n.contentSize),Z=e=>{E({...C,layout:{...null==C?void 0:C.layout,contentSize:e}})},F=bD(I)&&P,j=A(null==S||null===(r=S.layout)||void 0===r?void 0:r.wideSize),z=e=>{E({...C,layout:{...null==C?void 0:C.layout,wideSize:e}})},H=yD(I),V=ED(A(null==S||null===(o=S.spacing)||void 0===o?void 0:o.padding)),W=Array.isArray(null==I||null===(i=I.spacing)||void 0===i?void 0:i.padding)?null==I||null===(l=I.spacing)||void 0===l?void 0:l.padding:null==I||null===(a=I.spacing)||void 0===a||null===(s=a.padding)||void 0===s?void 0:s.sides,$=W&&W.some((e=>gD.includes(e))),U=e=>{const t=CD(e,W);E({...C,spacing:{...null==C?void 0:C.spacing,padding:t}})},G=()=>L("padding"),q=_D(I),K=ED(A(null==S||null===(c=S.spacing)||void 0===c?void 0:c.margin)),Y=Array.isArray(null==I||null===(u=I.spacing)||void 0===u?void 0:u.margin)?null==I||null===(d=I.spacing)||void 0===d?void 0:d.margin:null==I||null===(p=I.spacing)||void 0===p||null===(m=p.margin)||void 0===m?void 0:m.sides,X=Y&&Y.some((e=>gD.includes(e))),J=e=>{const t=CD(e,Y);E({...C,spacing:{...null==C?void 0:C.spacing,margin:t}})},Q=()=>L("margin"),ee=kD(I),te=A(null==S||null===(f=S.spacing)||void 0===f?void 0:f.blockGap),ne=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:null==e?void 0:e.left,bottom:null==e?void 0:e.top}:e}(te),re=Array.isArray(null==I||null===(h=I.spacing)||void 0===h?void 0:h.blockGap)?null==I||null===(g=I.spacing)||void 0===g?void 0:g.blockGap:null==I||null===(b=I.spacing)||void 0===b||null===(y=b.blockGap)||void 0===y?void 0:y.sides,oe=re&&re.some((e=>gD.includes(e))),ie=e=>{E({...C,spacing:{...null==C?void 0:C.spacing,blockGap:e}})},le=e=>{e||ie(null),!oe&&null!=e&&e.hasOwnProperty("top")?ie(e.top):ie({top:null==e?void 0:e.top,left:null==e?void 0:e.left})},ae=xD(I),se=A(null==S||null===(_=S.dimensions)||void 0===_?void 0:_.minHeight),ce=e=>{E({...C,dimensions:{...null==C?void 0:C.dimensions,minHeight:e}})},ue=wD(I),de=null==S?void 0:S.layout,{orientation:pe="horizontal"}=null!==(k=null==I?void 0:I.parentLayout)&&void 0!==k?k:{},me="horizontal"===pe?(0,N.__)("Width"):(0,N.__)("Height"),fe=e=>{E({...C,layout:{...null==C?void 0:C.layout,...e}})},he=(0,v.useCallback)((e=>({...e,layout:yp({...null==e?void 0:e.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0}),spacing:{...null==e?void 0:e.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...null==e?void 0:e.dimensions,minHeight:void 0}})),[]),ge=()=>L(!1);return(0,v.createElement)(x,{resetAllFilter:he,value:C,onChange:E,panelId:T},(M||F)&&(0,v.createElement)("span",{className:"span-columns"},(0,N.__)("Set the width of the main content area.")),M&&(0,v.createElement)(nT,{className:"single-column",label:(0,N.__)("Content size"),hasValue:()=>{var e;return!(null==C||null===(e=C.layout)||void 0===e||!e.contentSize)},onDeselect:()=>Z(void 0),isShownByDefault:B.contentSize,panelId:T},(0,v.createElement)(Bf.Z,{alignment:"flex-end",justify:"flex-start"},(0,v.createElement)(rm,{label:(0,N.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:O||"",onChange:e=>{Z(e)},units:R}),(0,v.createElement)(md.Z,null,(0,v.createElement)(om.Z,{icon:im.Z})))),F&&(0,v.createElement)(nT,{className:"single-column",label:(0,N.__)("Wide size"),hasValue:()=>{var e;return!(null==C||null===(e=C.layout)||void 0===e||!e.wideSize)},onDeselect:()=>z(void 0),isShownByDefault:B.wideSize,panelId:T},(0,v.createElement)(Bf.Z,{alignment:"flex-end",justify:"flex-start"},(0,v.createElement)(rm,{label:(0,N.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:j||"",onChange:e=>{z(e)},units:R}),(0,v.createElement)(md.Z,null,(0,v.createElement)(om.Z,{icon:lm.Z})))),H&&(0,v.createElement)(nT,{hasValue:()=>{var e,t;return!(null==C||null===(e=C.spacing)||void 0===e||!e.padding)&&Object.keys(null==C||null===(t=C.spacing)||void 0===t?void 0:t.padding).length},label:(0,N.__)("Padding"),onDeselect:()=>U(void 0),isShownByDefault:B.padding,className:w()({"tools-panel-item-spacing":D}),panelId:T},!D&&(0,v.createElement)(nD,{values:V,onChange:U,label:(0,N.__)("Padding"),sides:W,units:R,allowReset:!1,splitOnAxis:$,onMouseOver:G,onMouseOut:ge}),D&&(0,v.createElement)(uD,{values:V,onChange:U,label:(0,N.__)("Padding"),sides:W,units:R,allowReset:!1,splitOnAxis:$,onMouseOver:G,onMouseOut:ge})),q&&(0,v.createElement)(nT,{hasValue:()=>{var e,t;return!(null==C||null===(e=C.spacing)||void 0===e||!e.margin)&&Object.keys(null==C||null===(t=C.spacing)||void 0===t?void 0:t.margin).length},label:(0,N.__)("Margin"),onDeselect:()=>J(void 0),isShownByDefault:B.margin,className:w()({"tools-panel-item-spacing":D}),panelId:T},!D&&(0,v.createElement)(nD,{values:K,onChange:J,label:(0,N.__)("Margin"),sides:Y,units:R,allowReset:!1,splitOnAxis:X,onMouseOver:Q,onMouseOut:ge}),D&&(0,v.createElement)(uD,{values:K,onChange:J,label:(0,N.__)("Margin"),sides:Y,units:R,allowReset:!1,splitOnAxis:X,onMouseOver:Q,onMouseOut:ge})),ee&&(0,v.createElement)(nT,{hasValue:()=>{var e;return!(null==C||null===(e=C.spacing)||void 0===e||!e.blockGap)},label:(0,N.__)("Block spacing"),onDeselect:()=>ie(void 0),isShownByDefault:B.blockGap,className:w()({"tools-panel-item-spacing":D}),panelId:T},!D&&(oe?(0,v.createElement)(nD,{label:(0,N.__)("Block spacing"),min:0,onChange:le,units:R,sides:re,values:ne,allowReset:!1,splitOnAxis:oe}):(0,v.createElement)(rm,{label:(0,N.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:ie,units:R,value:te})),D&&(0,v.createElement)(uD,{label:(0,N.__)("Block spacing"),min:0,onChange:le,sides:oe?re:["top"],values:ne,allowReset:!1,splitOnAxis:oe})),ae&&(0,v.createElement)(nT,{hasValue:()=>{var e;return!(null==C||null===(e=C.dimensions)||void 0===e||!e.minHeight)},label:(0,N.__)("Min. height"),onDeselect:()=>{ce(void 0)},isShownByDefault:B.minHeight,panelId:T},(0,v.createElement)(pD,{label:(0,N.__)("Min. height"),value:se,onChange:ce})),ue&&(0,v.createElement)(sw.Z,{as:nT,spacing:2,hasValue:()=>!(null==C||!C.layout),label:me,onDeselect:()=>{fe({selfStretch:void 0,flexSize:void 0})},isShownByDefault:B.childLayout,panelId:T},(0,v.createElement)(fD,{value:de,onChange:fe,parentLayout:null==I?void 0:I.parentLayout})))}function ND(e){var t,n;let{clientId:r,attributes:o,forceShow:i}=e;const l=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,a=(0,v.useMemo)((()=>{const e=null!=l&&l.top?$d(null==l?void 0:l.top):0,t=null!=l&&l.right?$d(null==l?void 0:l.right):0,n=null!=l&&l.bottom?$d(null==l?void 0:l.bottom):0,r=null!=l&&l.left?$d(null==l?void 0:l.left):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:r,top:e?`calc(${e} * -1)`:0,right:t?`calc(${t} * -1)`:0,bottom:n?`calc(${n} * -1)`:0,left:r?`calc(${r} * -1)`:0}}),[l]),[s,c]=(0,v.useState)(!1),u=(0,v.useRef)(l),d=(0,v.useRef)();return(0,v.useEffect)((()=>((0,fn.ZP)(l,u.current)||i||(c(!0),u.current=l,d.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),d.current&&window.clearTimeout(d.current)})),[l,i]),s||i?(0,v.createElement)(NC,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,v.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function BD(e){var t,n;let{clientId:r,attributes:o,forceShow:i}=e;const l=null==o||null===(t=o.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,a=(0,v.useMemo)((()=>({borderTopWidth:null!=l&&l.top?$d(null==l?void 0:l.top):0,borderRightWidth:null!=l&&l.right?$d(null==l?void 0:l.right):0,borderBottomWidth:null!=l&&l.bottom?$d(null==l?void 0:l.bottom):0,borderLeftWidth:null!=l&&l.left?$d(null==l?void 0:l.left):0})),[l]),[s,c]=(0,v.useState)(!1),u=(0,v.useRef)(l),d=(0,v.useRef)();return(0,v.useEffect)((()=>((0,fn.ZP)(l,u.current)||i||(c(!0),u.current=l,d.current=setTimeout((()=>{c(!1)}),400)),()=>{c(!1),d.current&&window.clearTimeout(d.current)})),[l,i]),s||i?(0,v.createElement)(NC,{clientId:r,__unstableCoverTarget:!0,__unstableRefreshSize:l,__unstablePopoverSlot:"block-toolbar",shift:!1},(0,v.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}const LD="dimensions",PD="spacing";function AD(e){let{children:t,resetAllFilter:n}=e;const r=(0,v.useCallback)((e=>{const t=e.style,r=n(t);return{...e,style:r}}),[n]);return(0,v.createElement)(nh,{group:"dimensions",resetAllFilter:r},t)}function DD(e){var t,n;const{clientId:r,name:o,attributes:i,setAttributes:l,__unstableParentLayout:a}=e,s=Cp(o,a),c=function(e){const t=vD(e),n=bD(e),r=yD(e),o=_D(e),i=kD(e),l=xD(e),a=wD(e);return"web"===ci.Z.OS&&(t||n||r||o||i||l||a)}(s),u=i.style,[d,p]=function(){const[e,t]=(0,v.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=yu((0,S.Z)(ku));return(0,v.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!c)return null;const m={...fe(e.name,[LD,"__experimentalDefaultControls"]),...fe(e.name,[PD,"__experimentalDefaultControls"])};return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(TD,{as:AD,panelId:r,name:o,settings:s,value:u,onChange:e=>{l({style:yp(e)})},defaultControls:m,onVisualize:p}),!(null==s||null===(t=s.spacing)||void 0===t||!t.padding)&&(0,v.createElement)(BD,(0,Po.Z)({forceShow:"padding"===d},e)),!(null==s||null===(n=s.spacing)||void 0===n||!n.margin)&&(0,v.createElement)(ND,(0,Po.Z)({forceShow:"margin"===d},e)))}const RD=[...lA,TB,ZL,LD,PD],MD=e=>RD.some((t=>he(e,t)));function OD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={};return Om(e).forEach((e=>{t[e.key]=e.value})),t}const ZD={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[ZL],[`${iA}.__experimentalSkipSerialization`]:[iA],"dimensions.__experimentalSkipSerialization":[LD],"spacing.__experimentalSkipSerialization":[PD]},FD={...ZD,spacing:["spacing.blockGap"]},jD={gradients:"gradient"};function zD(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)return e;let r=e;return n||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;zD(r[t],[n],!0)}else 1===e.length&&delete r[e[0]]})),r}function HD(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:FD;if(!MD(t))return e;let{style:o}=n;return Object.entries(r).forEach((e=>{let[n,r]=e;const i=fe(t,n);!0===i&&(o=zD(o,r)),Array.isArray(i)&&i.forEach((e=>{const t=jD[e]||e;o=zD(o,[[...r,t]])}))})),e.style={...OD(o),...e.style},e}const VD=(0,Ao.o)((e=>t=>{const n=Iu();return(0,v.createElement)(v.Fragment,null,n&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(YL,t),(0,v.createElement)(uA,t),(0,v.createElement)(DB,t),(0,v.createElement)(DD,t)),(0,v.createElement)(e,t))}),"withToolbarControls"),WD=(0,Ao.o)((e=>t=>{var n,r;const o=`wp-elements-${(0,dd.Z)(e)}`,i=wp(t.name,ZL,"link"),l=(0,v.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,r=[];if(n&&Object.keys(n).length>0){var l;const e={...n,link:{...n.link,color:i||null===(l=n.link)||void 0===l?void 0:l.color}};for(const[t,n]of Object.entries(e)){const e=Mm(n,{selector:`.editor-styles-wrapper .${o} ${ee[t]}`});e&&r.push(e)}}return r.length>0?r:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),a=(0,v.useContext)(WI.__unstableElementContext);return(0,v.createElement)(v.Fragment,null,l&&a&&(0,b.createPortal)((0,v.createElement)("style",{dangerouslySetInnerHTML:{__html:l}}),a),(0,v.createElement)(e,(0,Po.Z)({},t,{className:null!==(r=t.attributes.style)&&void 0!==r&&r.elements?w()(t.className,o):t.className})))}));(0,_e.KJ)("blocks.registerBlockType","core/style/addAttribute",(function(e){return MD(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/style/addSaveProps",HD),(0,_e.KJ)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!MD(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let r={};return t&&(r=t(n)),HD(r,e,n,ZD)},e})),(0,_e.KJ)("editor.BlockEdit","core/style/with-block-controls",VD),(0,_e.KJ)("editor.BlockListBlock","core/editor/with-elements-styles",WD),(0,_e.KJ)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t;return he(e,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var $D=n(42253);function UD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"90deg";const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,G.l7)([q.Z]);var GD=function(e){let{values:t}=e;return t?(0,v.createElement)(NT,{colorValue:UD(t,"135deg")}):(0,v.createElement)(Od.Z,{icon:$D.Z})};function qD(e){let{label:t,value:n,colors:r,disableCustomColors:o,enableAlpha:i,onChange:l}=e;const[a,s]=(0,v.useState)(!1);return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Mo.ZP,{className:"components-color-list-picker__swatch-button",onClick:()=>s((e=>!e))},(0,v.createElement)(Bf.Z,{justify:"flex-start",spacing:2},n?(0,v.createElement)(NT,{colorValue:n,className:"components-color-list-picker__swatch-color"}):(0,v.createElement)(Od.Z,{icon:$D.Z}),(0,v.createElement)("span",null,t))),a&&(0,v.createElement)(QN,{className:"components-color-list-picker__color-picker",colors:r,value:n,clearable:!1,onChange:l,disableCustomColors:o,enableAlpha:i}))}var KD=function(e){let{colors:t,labels:n,value:r=[],disableCustomColors:o,enableAlpha:i,onChange:l}=e;return(0,v.createElement)("div",{className:"components-color-list-picker"},n.map(((e,n)=>(0,v.createElement)(qD,{key:n,label:e,value:r[n],colors:t,disableCustomColors:o,enableAlpha:i,onChange:e=>{const t=r.slice();t[n]=e,l(t)}}))))};const YD=["#333","#CCC"];function XD(e){let{value:t,onChange:n}=e;const r=!!t,o=r?t:YD,i=UD(o),l=(a=o).map(((e,t)=>({position:100*t/(a.length-1),color:e})));var a;return(0,v.createElement)(iL,{disableInserter:!0,background:i,hasGradient:r,value:l,onChange:e=>{const t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>{let{color:t}=e;return t}))}(e);n(t)}})}var JD=function(e){let{clearable:t=!0,unsetable:n=!0,colorPalette:r,duotonePalette:o,disableCustomColors:i,disableCustomDuotone:l,value:a,onChange:s}=e;const[c,u]=(0,v.useMemo)((()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map((e=>{let{color:t}=e;return{color:t,brightness:(0,G.Vi)(t).brightness()}})).reduce(((e,t)=>{let[n,r]=e;return[t.brightness<=n.brightness?t:n,t.brightness>=r.brightness?t:r]}),[{brightness:1},{brightness:0}]).map((e=>{let{color:t}=e;return t}));var e}),[r]),d="unset"===a,p=(0,v.createElement)(WN.Option,{key:"unset",value:"unset",isSelected:d,tooltipText:(0,N.__)("Unset"),className:"components-duotone-picker__color-indicator",onClick:()=>{s(d?void 0:"unset")}}),m=o.map((e=>{let{colors:t,slug:n,name:r}=e;const o={background:UD(t,"135deg"),color:"transparent"},i=null!=r?r:(0,N.sprintf)((0,N.__)("Duotone code: %s"),n),l=r?(0,N.sprintf)((0,N.__)("Duotone: %s"),r):i,c=An()(t,a);return(0,v.createElement)(WN.Option,{key:n,value:t,isSelected:c,"aria-label":l,tooltipText:i,style:o,onClick:()=>{s(c?void 0:t)}})}));return(0,v.createElement)(WN,{options:n?[p,...m]:m,actions:!!t&&(0,v.createElement)(WN.ButtonAction,{onClick:()=>s(void 0)},(0,N.__)("Clear"))},(0,v.createElement)(cw.Z,{paddingTop:4},(0,v.createElement)(sw.Z,{spacing:3},!i&&!l&&(0,v.createElement)(XD,{value:d?void 0:a,onChange:s}),!l&&(0,v.createElement)(KD,{labels:[(0,N.__)("Shadows"),(0,N.__)("Highlights")],colors:r,value:d?void 0:a,disableCustomColors:i,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=c),e[1]||(e[1]=u);const t=e.length>=2?e:void 0;s(t)}}))))},QD=n(5057),eR=function(e){let t,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}=e;return t="unset"===l?(0,v.createElement)(NT,{className:"block-editor-duotone-control__unset-indicator"}):l?(0,v.createElement)(GD,{values:l}):(0,v.createElement)(om.Z,{icon:QD.Z}),(0,v.createElement)(t_.Z,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,N.__)("Duotone"),variant:"toolbar"},renderToggle:e=>{let{isOpen:n,onToggle:r}=e;return(0,v.createElement)(Fo,{showTooltip:!0,onClick:r,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==Al.DOWN||(e.preventDefault(),r())},label:(0,N.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,v.createElement)(Ou.Z,{label:(0,N.__)("Duotone")},(0,v.createElement)("div",{className:"block-editor-duotone-control__description"},(0,N.__)("Create a two-tone color effect without losing your original image.")),(0,v.createElement)(JD,{colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:l,onChange:a}))})};const tR=[];function nR(e){let{selector:t,id:n,colors:r}=e;return"unset"===r?(0,v.createElement)(Ak,{selector:t}):(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Dk,{id:n,colors:r}),(0,v.createElement)(Pk,{id:n,selector:t}))}function rR(e){let{presetSetting:t,defaultSetting:n}=e;const r=!bp(n),o=bp(`${t}.custom`)||tR,i=bp(`${t}.theme`)||tR,l=bp(`${t}.default`)||tR;return(0,v.useMemo)((()=>[...o,...i,...r?tR:l]),[r,o,i,l])}function oR(e,t){if(!e)return;const n=null==t?void 0:t.find((t=>{let{slug:n}=t;return e===`var:preset|duotone|${n}`}));return n?n.colors:void 0}function iR(e){var t;let{attributes:n,setAttributes:r}=e;const o=null==n?void 0:n.style,i=null==o||null===(t=o.color)||void 0===t?void 0:t.duotone,l=rR({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=rR({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),s=!bp("color.custom"),c=!bp("color.customDuotone")||0===(null==a?void 0:a.length)&&s;if(0===(null==l?void 0:l.length)&&c)return null;const u=Array.isArray(i)?i:oR(i,l);return(0,v.createElement)(Ru,{group:"block",__experimentalShareWithChildBlocks:!0},(0,v.createElement)(eR,{duotonePalette:l,colorPalette:a,disableCustomDuotone:c,disableCustomColors:s,value:u,onChange:e=>{const t=function(e,t){if(!e||!Array.isArray(e))return;const n=null==t?void 0:t.find((t=>{var n;return null==t||null===(n=t.colors)||void 0===n?void 0:n.every(((t,n)=>t===e[n]))}));return n?`var:preset|duotone|${n.slug}`:void 0}(e,l),n={...o,color:{...null==o?void 0:o.color,duotone:null!=t?t:e}};r({style:n})}}))}(0,G.l7)([q.Z]);const lR=(0,Ao.o)((e=>t=>{const n=he(t.name,"color.__experimentalDuotone"),r=(0,E.Z)((e=>e(ku).__unstableGetContentLockingParent(t.clientId)),[t.clientId]);return(0,v.createElement)(v.Fragment,null,n&&!r&&(0,v.createElement)(iR,t),(0,v.createElement)(e,t))}),"withDuotoneControls");function aR(e){let{name:t,duotoneStyle:n,id:r}=e;const o=rR({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=(0,v.useContext)(WI.__unstableElementContext);if(!i||!n)return null;let l=n;Array.isArray(l)||"unset"===l||(l=oR(l,o));const a=function(e,t){const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}(`.editor-styles-wrapper .${r}`,fe(t,"color.__experimentalDuotone"));return(0,b.createPortal)((0,v.createElement)(nR,{selector:a,id:r,colors:l}),i)}const sR=(0,Ao.o)((e=>t=>{var n,r,o;const i=fe(t.name,"color.__experimentalDuotone"),l=`wp-duotone-${(0,dd.Z)(e)}`,a=i?w()(null==t?void 0:t.className,l):null==t?void 0:t.className,s=null==t||null===(n=t.attributes)||void 0===n||null===(r=n.style)||void 0===r||null===(o=r.color)||void 0===o?void 0:o.duotone;return(0,v.createElement)(v.Fragment,null,i&&s&&(0,v.createElement)(aR,{name:null==t?void 0:t.name,duotoneStyle:s,id:l}),(0,v.createElement)(e,(0,Po.Z)({},t,{className:a})))}),"withDuotoneStyles");(0,_e.KJ)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return he(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,_e.KJ)("editor.BlockEdit","core/editor/duotone/with-editor-controls",lR),(0,_e.KJ)("editor.BlockListBlock","core/editor/duotone/with-styles",sR);var cR=n(35631);const uR="__experimentalLayout";function dR(e){let{clientId:t,setAttributes:n,attributes:r,name:o}=e;const{layout:i}=r,l=bp("layout"),{themeSupportsLayout:a,isContentLocked:s}=(0,E.Z)((e=>{const{getSettings:n,__unstableGetContentLockingParent:r}=e(ku);return{themeSupportsLayout:n().supportsLayout,isContentLocked:r(t)}}),[t]),c=fe(o,uR,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:p=!0,default:m}=c;if(!d)return null;const f=!(!p||!l||null!=i&&i.type&&"default"!==(null==i?void 0:i.type)&&"constrained"!==(null==i?void 0:i.type)&&(null==i||!i.inherit)),h=i||m||{},{inherit:g=!1,type:b="default",contentSize:y=null}=h;if(("default"===b||"constrained"===b)&&!a)return null;const _=jm(b),k=jm("constrained"),x=!h.type&&(y||g),w=!!g||!!y,C=e=>n({layout:e});return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(nh,null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Layout")},f&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,N.__)("Inner blocks use content width"),checked:"constrained"===(null==_?void 0:_.name)||w,onChange:()=>n({layout:{type:"constrained"===(null==_?void 0:_.name)||w?"default":"constrained"}}),help:"constrained"===(null==_?void 0:_.name)||w?(0,N.__)("Nested blocks use content width with options for full and wide widths."):(0,N.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})),!g&&u&&(0,v.createElement)(pR,{type:b,onChange:e=>n({layout:{type:e}})}),_&&"default"!==_.name&&(0,v.createElement)(_.inspectorControls,{layout:h,onChange:C,layoutBlockSupport:c}),k&&x&&(0,v.createElement)(k.inspectorControls,{layout:h,onChange:C,layoutBlockSupport:c}))),!g&&!s&&_&&(0,v.createElement)(_.toolBarControls,{layout:h,onChange:C,layoutBlockSupport:c}))}function pR(e){let{type:t,onChange:n}=e;return(0,v.createElement)(cR.Z,null,Fm.map((e=>{let{name:r,label:o}=e;return(0,v.createElement)(Mo.ZP,{key:r,isPressed:t===r,onClick:()=>n(r)},o)})))}const mR=(0,Ao.o)((e=>t=>{const{name:n}=t;return[he(n,uR)&&(0,v.createElement)(dR,(0,Po.Z)({key:"layout"},t)),(0,v.createElement)(e,(0,Po.Z)({key:"edit"},t))]}),"withInspectorControls"),fR=(0,Ao.o)((e=>t=>{const{name:n,attributes:r,block:o}=t,i=he(n,uR),l=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return!!t().disableLayoutStyles})),a=i&&!l,s=(0,dd.Z)(e),c=bp("layout")||{},u=(0,v.useContext)(WI.__unstableElementContext),{layout:d}=r,{default:p}=fe(n,uR)||{},m=null!=d&&d.inherit||null!=d&&d.contentSize||null!=d&&d.wideSize?{...d,type:"constrained"}:d||p||{},f=i?function(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,E.Z)((e=>{var t;const{getSettings:n}=e(ku);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),o=bp("layout")||{},{attributes:i={},name:l}=n,{layout:a}=i,{default:s}=fe(l,uR)||{},c=null!=a&&a.inherit||null!=a&&a.contentSize||null!=a&&a.wideSize?{...a,type:"constrained"}:a||s||{},u=[];var d,p;return null!=o&&null!==(e=o.definitions)&&void 0!==e&&null!==(t=e[(null==c?void 0:c.type)||"default"])&&void 0!==t&&t.className&&u.push(null==o||null===(d=o.definitions)||void 0===d||null===(p=d[(null==c?void 0:c.type)||"default"])||void 0===p?void 0:p.className),(null!=c&&c.inherit||null!=c&&c.contentSize||"constrained"===(null==c?void 0:c.type))&&r&&u.push("has-global-padding"),null!=c&&c.orientation&&u.push(`is-${(0,U.kebabCase)(c.orientation)}`),null!=c&&c.justifyContent&&u.push(`is-content-justification-${(0,U.kebabCase)(c.justifyContent)}`),null!=c&&c.flexWrap&&"nowrap"===c.flexWrap&&u.push("is-nowrap"),u}(o):null,h=`.wp-container-${s}.wp-container-${s}`,g=null!==bp("spacing.blockGap");let y;if(a){var _;const e=jm((null==m?void 0:m.type)||"default");y=null==e||null===(_=e.getLayoutStyle)||void 0===_?void 0:_.call(e,{blockName:n,selector:h,layout:m,layoutDefinitions:null==c?void 0:c.definitions,style:null==r?void 0:r.style,hasBlockGapSupport:g})}const k=w()({[`wp-container-${s}`]:a&&!!y},f);return(0,v.createElement)(v.Fragment,null,a&&u&&!!y&&(0,b.createPortal)((0,v.createElement)($m,{blockName:n,selector:h,css:y,layout:m,style:null==r?void 0:r.style}),u),(0,v.createElement)(e,(0,Po.Z)({},t,{__unstableLayoutClassNames:k})))})),hR=(0,Ao.o)((e=>t=>{const{attributes:n}=t,{style:{layout:r={}}={}}=n,{selfStretch:o,flexSize:i}=r,l=o||i,a=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return!!t().disableLayoutStyles})),s=l&&!a,c=(0,v.useContext)(WI.__unstableElementContext),u=(0,dd.Z)(e),d=`.wp-container-content-${u}`;let p="";"fixed"===o&&i?p+=`${d} {\n\t\t\t\tflex-basis: ${i};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===o&&(p+=`${d} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`);const m=w()(null==t?void 0:t.className,{[`wp-container-content-${u}`]:s&&!!p});return(0,v.createElement)(v.Fragment,null,s&&c&&!!p&&(0,b.createPortal)((0,v.createElement)("style",null,p),c),(0,v.createElement)(e,(0,Po.Z)({},t,{className:m})))}));function gR(e){let{clientId:t,stopEditingAsBlock:n}=e;const r=(0,E.Z)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=e(ku);return n(t)||r(t,!0)}),[t]);return(0,v.useEffect)((()=>{r||n()}),[r]),null}(0,_e.KJ)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t,n;return"type"in(null!==(t=null===(n=e.attributes)||void 0===n?void 0:n.layout)&&void 0!==t?t:{})||he(e,uR)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,_e.KJ)("editor.BlockListBlock","core/editor/layout/with-layout-styles",fR),(0,_e.KJ)("editor.BlockListBlock","core/editor/layout/with-child-layout-styles",hR),(0,_e.KJ)("editor.BlockEdit","core/editor/layout/with-inspector-controls",mR);const vR=(0,Ao.o)((e=>t=>{const{getBlockListSettings:n,getSettings:r}=(0,E.Z)(ku),o=(0,v.useRef)(),{templateLock:i,isLockedByParent:l,isEditingAsBlocks:a}=(0,E.Z)((e=>{const{__unstableGetContentLockingParent:n,getTemplateLock:r,__unstableGetTemporarilyEditingAsBlocks:o}=e(ku);return{templateLock:r(t.clientId),isLockedByParent:!!n(t.clientId),isEditingAsBlocks:o()===t.clientId}}),[t.clientId]),{updateSettings:s,updateBlockListSettings:c,__unstableSetTemporarilyEditingAsBlocks:u}=(0,S.Z)(ku),d=!l&&"contentOnly"===i,{__unstableMarkNextChangeAsNotPersistent:p,updateBlockAttributes:m}=(0,S.Z)(ku),f=(0,v.useCallback)((()=>{p(),m(t.clientId,{templateLock:"contentOnly"}),c(t.clientId,{...n(t.clientId),templateLock:"contentOnly"}),s({focusMode:o.current}),u()}),[t.clientId,o,s,c,n,p,m,u]);return d||a?(0,v.createElement)(v.Fragment,null,a&&!d&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(gR,{clientId:t.clientId,stopEditingAsBlock:f}),(0,v.createElement)(Ru,{group:"other"},(0,v.createElement)(Fo,{onClick:()=>{f()}},(0,N.__)("Done")))),!a&&d&&t.isSelected&&(0,v.createElement)(vS,null,(e=>{let{onClose:i}=e;return(0,v.createElement)(Zu.Z,{onClick:()=>{p(),m(t.clientId,{templateLock:void 0}),c(t.clientId,{...n(t.clientId),templateLock:!1}),o.current=r().focusMode,s({focusMode:!0}),u(t.clientId),i()}},(0,N.__)("Modify"))})),(0,v.createElement)(e,(0,Po.Z)({},t,{className:w()(t.className,a&&"is-content-locked-editing-as-blocks")}))):(0,v.createElement)(e,t)}),"withToolbarControls");(0,_e.KJ)("editor.BlockEdit","core/content-lock-ui/with-block-controls",vR);function bR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e.name.startsWith("core/"))return!1;const n=fe(e,"__experimentalMetadata");return!!(!0===n||null!=n&&n[t])}function yR(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:ZB(e)||void 0,style:OD({border:n})}}function _R(e){const{colors:t}=IB(),n=yR(e),{borderColor:r}=e;if(r){const e=PB({colors:t,namedColor:r});n.style.borderColor=e.color}return n}(0,_e.KJ)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.metadata)&&void 0!==n&&n.type||bR(e,"name")&&(e.attributes={...e.attributes,metadata:{type:"object"}}),e})),(0,_e.KJ)("blocks.getSaveContent.extraProps","core/metadata/save-props",(function(e,t,n){return bR(t)&&(e.metadata=n.metadata),e})),(0,_e.KJ)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||bR(e,"name",!1)&&(e.__experimentalLabel=(e,t)=>{let{context:n}=t;const{metadata:r}=e;if("list-view"===n&&null!=r&&r.name)return r.name}),e}));var kR=n(40566),xR=n(36760),wR=n(28994);const CR=[{icon:kR.Z,title:(0,N.__)("Align text left"),align:"left"},{icon:xR.Z,title:(0,N.__)("Align text center"),align:"center"},{icon:wR.Z,title:(0,N.__)("Align text right"),align:"right"}],ER={position:"bottom right",variant:"toolbar"};var SR=function(e){let{value:t,onChange:n,alignmentControls:r=CR,label:o=(0,N.__)("Align text"),describedBy:i=(0,N.__)("Change text alignment"),isCollapsed:l=!0,isToolbar:a}=e;function s(e){return()=>n(t===e?void 0:e)}const c=r.find((e=>e.align===t)),u=a?Vo:Mu,d=a?{isCollapsed:l}:{toggleProps:{describedBy:i},popoverProps:ER};return(0,v.createElement)(u,(0,Po.Z)({icon:c?c.icon:(0,N.isRTL)()?wR.Z:kR.Z,label:o,controls:r.map((e=>{const{align:n}=e,r=t===n;return{...e,isActive:r,role:l?"menuitemradio":void 0,onClick:s(n)}}))},d))};const IR=e=>(0,v.createElement)(SR,(0,Po.Z)({},e,{isToolbar:!1})),TR=(0,v.createElement)(tp.Wj,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,v.createElement)(tp.y$,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"}));var NR=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:l,preview:a,isColumnLayout:s,withIllustration:c,...u}=e,[d,{width:p}]=ud();let m;"number"==typeof p&&(m={"is-large":p>=480,"is-medium":p>=160&&p<480,"is-small":p<160});const f=w()("components-placeholder",i,m,c?"has-illustration":null),h=w()("components-placeholder__fieldset",{"is-column-layout":s});return(0,v.createElement)("div",(0,Po.Z)({},u,{className:f}),c?TR:null,d,l,a&&(0,v.createElement)("div",{className:"components-placeholder__preview"},a),(0,v.createElement)("div",{className:"components-placeholder__label"},(0,v.createElement)(Od.Z,{icon:t}),r),(0,v.createElement)("fieldset",{className:h},!!o&&(0,v.createElement)("legend",{className:"components-placeholder__instructions"},o),n))},BR=n(99231),LR=function(e){let{icon:t=BR.Z,label:n=(0,N.__)("Choose variation"),instructions:r=(0,N.__)("Select a variation to start with."),variations:o,onSelect:i,allowSkip:l}=e;const a=w()("block-editor-block-variation-picker",{"has-many-variations":o.length>4});return(0,v.createElement)(NR,{icon:t,label:n,instructions:r,className:a},(0,v.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,N.__)("Block variations")},o.map((e=>(0,v.createElement)("li",{key:e.name},(0,v.createElement)(Mo.ZP,{variant:"secondary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>i(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,v.createElement)("span",{className:"block-editor-block-variation-picker__variation-label"},e.title))))),l&&(0,v.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,v.createElement)(Mo.ZP,{variant:"link",onClick:()=>i()},(0,N.__)("Skip"))))},PR=(0,Ao.o)((e=>t=>{const n=bp("color.palette"),r=!bp("color.custom"),o=void 0===t.colors?n:t.colors,i=void 0===t.disableCustomColors?r:t.disableCustomColors,l=!(0,U.isEmpty)(o)||!i;return(0,v.createElement)(e,(0,Po.Z)({},t,{colors:o,disableCustomColors:i,hasColorsToChoose:l}))}),"withColorContext")(QN);const AR=(0,v.createContext)({}),DR=()=>(0,v.useContext)(AR);function RR(e){let{id:t,url:n,naturalWidth:r,naturalHeight:o,onFinishEditing:i,onSaveImage:l,children:a}=e;const s=function(e){let{url:t,naturalWidth:n,naturalHeight:r}=e;const[o,i]=(0,v.useState)(),[l,a]=(0,v.useState)(),[s,c]=(0,v.useState)({x:0,y:0}),[u,d]=(0,v.useState)(100),[p,m]=(0,v.useState)(0),f=n/r,[h,g]=(0,v.useState)(f),b=(0,v.useCallback)((()=>{const e=(p+90)%360;let n=f;if(p%180==90&&(n=1/f),0===e)return i(),m(e),g(f),void c({x:-s.y*n,y:s.x*n});const r=new window.Image;r.src=t,r.onload=function(t){const r=document.createElement("canvas");let o=0,l=0;e%180?(r.width=t.target.height,r.height=t.target.width):(r.width=t.target.width,r.height=t.target.height),90!==e&&180!==e||(o=r.width),270!==e&&180!==e||(l=r.height);const a=r.getContext("2d");a.translate(o,l),a.rotate(e*Math.PI/180),a.drawImage(t.target,0,0),r.toBlob((t=>{i(URL.createObjectURL(t)),m(e),g(r.width/r.height),c({x:-s.y*n,y:s.x*n})}))};const o=(0,_e.O)("media.crossOrigin",void 0,t);"string"==typeof o&&(r.crossOrigin=o)}),[p,f]);return(0,v.useMemo)((()=>({editedUrl:o,setEditedUrl:i,crop:l,setCrop:a,position:s,setPosition:c,zoom:u,setZoom:d,rotation:p,setRotation:m,rotateClockwise:b,aspect:h,setAspect:g,defaultAspect:f})),[o,l,s,u,p,b,h,f])}({url:n,naturalWidth:r,naturalHeight:o}),c=function(e){let{crop:t,rotation:n,height:r,width:o,aspect:i,url:l,id:a,onSaveImage:s,onFinishEditing:c}=e;const{createErrorNotice:u}=(0,S.Z)(Px.h),[d,p]=(0,v.useState)(!1),m=(0,v.useCallback)((()=>{p(!1),c()}),[p,c]),f=(0,v.useCallback)((()=>{p(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=l,(0,y.default)({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{s({id:e.id,url:e.source_url,height:r&&o?o/i:void 0})})).catch((e=>{u((0,N.sprintf)((0,N.__)("Could not edit image. %s"),(0,Y.Z)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{p(!1),c()}))}),[p,t,n,r,o,i,l,s,u,p,c]);return(0,v.useMemo)((()=>({isInProgress:d,apply:f,cancel:m})),[d,f,m])}({id:t,url:n,onSaveImage:l,onFinishEditing:i,...s}),u=(0,v.useMemo)((()=>({...s,...c})),[s,c]);return(0,v.createElement)(AR.Provider,{value:u},a)}var MR=function(e,t){return MR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},MR(e,t)},OR=function(){return OR=Object.assign||function(e){for(var t,n=1,r=arguments.length;nu*o?{width:u*o,height:u}:{width:c,height:c/o}}function zR(e,t,n,r,o){void 0===o&&(o=0);var i=XR(t.width,t.height,o),l=i.width,a=i.height;return{x:HR(e.x,l,n.width,r),y:HR(e.y,a,n.height,r)}}function HR(e,t,n,r){var o=t*r/2-n/2;return JR(e,-o,o)}function VR(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function WR(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function $R(e,t,n,r,o,i,l){void 0===i&&(i=0),void 0===l&&(l=!0);var a=l?UR:GR,s=XR(t.width,t.height,i),c=XR(t.naturalWidth,t.naturalHeight,i),u={x:a(100,((s.width-n.width/o)/2-e.x/o)/s.width*100),y:a(100,((s.height-n.height/o)/2-e.y/o)/s.height*100),width:a(100,n.width/s.width*100/o),height:a(100,n.height/s.height*100/o)},d=Math.round(a(c.width,u.width*c.width/100)),p=Math.round(a(c.height,u.height*c.height/100)),m=c.width>=c.height*r?{width:Math.round(p*r),height:p}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:OR(OR({},m),{x:Math.round(a(c.width-m.width,u.x*c.width/100)),y:Math.round(a(c.height-m.height,u.y*c.height/100))})}}function UR(e,t){return Math.min(e,Math.max(0,t))}function GR(e,t){return t}function qR(e,t,n,r,o,i){var l=XR(t.width,t.height,n),a=JR(r.width/l.width*(100/e.width),o,i);return{crop:{x:a*l.width/2-r.width/2-l.width*a*(e.x/100),y:a*l.height/2-r.height/2-l.height*a*(e.y/100)},zoom:a}}function KR(e,t,n,r,o,i){void 0===n&&(n=0);var l=XR(t.naturalWidth,t.naturalHeight,n),a=JR(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),s=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((l.width-e.width)/2-e.x)*s,y:((l.height-e.height)/2-e.y)*s},zoom:a}}function YR(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function XR(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function JR(e,t,n){return Math.min(Math.max(e,t),n)}function QR(){for(var e=[],t=0;t0})).join(" ").trim()}var eM=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=v.createRef(),n.videoRef=v.createRef(),n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=qR(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=KR(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,l,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect();var s=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,p=void 0;if(a.offsetWidthd?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":p={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":p={width:n.containerRect.height*d,height:n.containerRect.height};break;case"auto-cover":p=c>u?{width:n.containerRect.width,height:n.containerRect.width/d}:{width:n.containerRect.height*d,height:n.containerRect.height}}else p={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=OR(OR({},p),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var m=n.props.cropSize?n.props.cropSize:jR(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===m.height&&(null===(l=n.state.cropSize)||void 0===l?void 0:l.width)===m.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(m),n.setState({cropSize:m},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(m),m}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=OR({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},l=n.props.restrictPosition?zR(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(l)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=FR()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,l=o.zoom;return{x:(t+i.x)/l,y:(r+i.y)/l}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var l=JR(e,n.props.minZoom,n.props.maxZoom);if(i){var a=n.getPointOnContainer(t),s=n.getPointOnMedia(a),c={x:s.x*l-a.x,y:s.y*l-a.y},u=n.props.restrictPosition?zR(c,n.mediaSize,n.state.cropSize,l,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(l)}},n.getCropData=function(){return n.state.cropSize?$R(n.props.restrictPosition?zR(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?zR(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}MR(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,l,a,s,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(l=this.props.crop)||void 0===l?void 0:l.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(s=this.props.crop)||void 0===s?void 0:s.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=VR(n,r),this.lastPinchRotation=WR(n,r),this.onDragStart(YR(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=YR(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=VR(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var l=WR(r,o),a=n.props.rotation+(l-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=l}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,i=t.transform,l=t.crop,a=l.x,s=l.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,h=m.cropAreaStyle,g=m.mediaStyle,b=t.classes,y=b.containerClassName,_=b.cropAreaClassName,k=b.mediaClassName,x=t.objectFit;return v.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:QR("reactEasyCrop_Container",y)},n?v.createElement("img",OR({alt:"",className:QR("reactEasyCrop_Image","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical","auto-cover"===x&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},o,{src:n,ref:this.imageRef,style:OR(OR({},g),{transform:i||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):r&&v.createElement("video",OR({autoPlay:!0,loop:!0,muted:!0,className:QR("reactEasyCrop_Video","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical","auto-cover"===x&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),k)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:OR(OR({},g),{transform:i||"translate(".concat(a,"px, ").concat(s,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return v.createElement("source",OR({key:e.src},e))}))),this.state.cropSize&&v.createElement("div",{style:OR(OR({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:QR("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",_)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(v.Component);const tM={placement:"bottom-start",variant:"toolbar"};function nM(e){let{url:t,width:n,height:r,clientWidth:o,naturalHeight:i,naturalWidth:l,borderProps:a}=e;const{isInProgress:s,editedUrl:c,position:u,zoom:d,aspect:p,setPosition:m,setCrop:f,setZoom:h,rotation:g}=DR();let b=r||o*i/l;return g%180==90&&(b=o*l/i),(0,v.createElement)("div",{className:w()("wp-block-image__crop-area",null==a?void 0:a.className,{"is-applying":s}),style:{...null==a?void 0:a.style,width:n||o,height:b}},(0,v.createElement)(eM,{image:c||t,disabled:s,minZoom:1,maxZoom:3,crop:u,zoom:d/100,aspect:p,onCropChange:e=>{m(e)},onCropComplete:e=>{f(e)},onZoomChange:e=>{h(100*e)}}),s&&(0,v.createElement)(zw.ZP,null))}var rM=n(13356);function oM(){const{isInProgress:e,zoom:t,setZoom:n}=DR();return(0,v.createElement)(t_.Z,{contentClassName:"wp-block-image__zoom",popoverProps:tM,renderToggle:t=>{let{isOpen:n,onToggle:r}=t;return(0,v.createElement)(Fo,{icon:rM.Z,label:(0,N.__)("Zoom"),onClick:r,"aria-expanded":n,disabled:e})},renderContent:()=>(0,v.createElement)(iN,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var iM=n(2618);function lM(e){let{aspectRatios:t,isDisabled:n,label:r,onClick:o,value:i}=e;return(0,v.createElement)(Ou.Z,{label:r},t.map((e=>{let{title:t,aspect:r}=e;return(0,v.createElement)(Zu.Z,{key:r,disabled:n,onClick:()=>{o(r)},role:"menuitemradio",isSelected:r===i,icon:r===i?If.Z:void 0},t)})))}function aM(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:r,setAspect:o,defaultAspect:i}=DR();return(0,v.createElement)(zo.Z,{icon:iM.Z,label:(0,N.__)("Aspect Ratio"),popoverProps:tM,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(lM,{isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,N.__)("Original"),aspect:i},{title:(0,N.__)("Square"),aspect:1}]}),(0,v.createElement)(lM,{label:(0,N.__)("Landscape"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,N.__)("16:10"),aspect:1.6},{title:(0,N.__)("16:9"),aspect:16/9},{title:(0,N.__)("4:3"),aspect:4/3},{title:(0,N.__)("3:2"),aspect:1.5}]}),(0,v.createElement)(lM,{label:(0,N.__)("Portrait"),isDisabled:n,onClick:e=>{o(e),t()},value:r,aspectRatios:[{title:(0,N.__)("10:16"),aspect:.625},{title:(0,N.__)("9:16"),aspect:9/16},{title:(0,N.__)("3:4"),aspect:3/4},{title:(0,N.__)("2:3"),aspect:2/3}]}))}))}var sM=n(46335);function cM(){const{isInProgress:e,rotateClockwise:t}=DR();return(0,v.createElement)(Fo,{icon:sM.Z,label:(0,N.__)("Rotate"),onClick:t,disabled:e})}function uM(){const{isInProgress:e,apply:t,cancel:n}=DR();return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Fo,{onClick:t,disabled:e},(0,N.__)("Apply")),(0,v.createElement)(Fo,{onClick:n},(0,N.__)("Cancel")))}function dM(e){let{id:t,url:n,width:r,height:o,clientWidth:i,naturalHeight:l,naturalWidth:a,onSaveImage:s,onFinishEditing:c,borderProps:u}=e;return(0,v.createElement)(RR,{id:t,url:n,naturalWidth:a,naturalHeight:l,onSaveImage:s,onFinishEditing:c},(0,v.createElement)(nM,{borderProps:u,url:n,width:r,height:o,clientWidth:i,naturalHeight:l,naturalWidth:a}),(0,v.createElement)(Ru,null,(0,v.createElement)(Vo,null,(0,v.createElement)(oM,null),(0,v.createElement)(Oo.Z,null,(e=>(0,v.createElement)(aM,{toggleProps:e}))),(0,v.createElement)(cM,null)),(0,v.createElement)(Vo,null,(0,v.createElement)(uM,null))))}const pM=[25,50,75,100],mM=()=>{};function fM(e){let{imageSizeHelp:t,imageWidth:n,imageHeight:r,imageSizeOptions:o=[],isResizable:i=!0,slug:l,width:a,height:s,onChange:c,onChangeImage:u=mM}=e;const{currentHeight:d,currentWidth:p,updateDimension:m,updateDimensions:f}=function(e,t,n,r,o){var i,l;const[a,s]=(0,v.useState)(null!==(i=null!=t?t:r)&&void 0!==i?i:""),[c,u]=(0,v.useState)(null!==(l=null!=e?e:n)&&void 0!==l?l:"");return(0,v.useEffect)((()=>{void 0===t&&void 0!==r&&s(r),void 0===e&&void 0!==n&&u(n)}),[r,n]),(0,v.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&s(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(c)&&u(e)}),[t,e]),{currentHeight:c,currentWidth:a,updateDimension:(e,t)=>{"width"===e?s(t):u(t),o({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{u(null!=e?e:n),s(null!=t?t:r),o({height:e,width:t})}}}(s,a,r,n,c);return(0,v.createElement)(v.Fragment,null,o&&o.length>0&&(0,v.createElement)(BT.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Image size"),value:l,options:o,onChange:u,help:t}),i&&(0,v.createElement)("div",{className:"block-editor-image-size-control"},(0,v.createElement)("p",null,(0,N.__)("Image dimensions")),(0,v.createElement)(Bf.Z,{align:"baseline",spacing:"3"},(0,v.createElement)(Gp.Z,{className:"block-editor-image-size-control__width",label:(0,N.__)("Width"),value:p,min:1,onChange:e=>m("width",e)}),(0,v.createElement)(Gp.Z,{className:"block-editor-image-size-control__height",label:(0,N.__)("Height"),value:d,min:1,onChange:e=>m("height",e)})),(0,v.createElement)(Bf.Z,null,(0,v.createElement)(cR.Z,{"aria-label":(0,N.__)("Image size presets")},pM.map((e=>{const t=Math.round(n*(e/100)),o=Math.round(r*(e/100)),i=p===t&&d===o;return(0,v.createElement)(Mo.ZP,{key:e,isSmall:!0,variant:i?"primary":void 0,isPressed:i,onClick:()=>f(o,t)},e,"%")}))),(0,v.createElement)(Mo.ZP,{isSmall:!0,onClick:()=>f()},(0,N.__)("Reset")))))}var hM=n(79636);const gM=()=>{};var vM=e=>{let{value:t,onChange:n=gM,settings:r}=e;if(!r||!r.length)return null;const o=e=>r=>{n({...t,[e.id]:r})},i=r.map((e=>(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:o(e),checked:!!t&&!!t[e.id]})));return(0,v.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,v.createElement)(n_.Z,{as:"legend"},(0,N.__)("Currently selected link settings")),i)},bM=function e(t){let{settingsOpen:n,setSettingsOpen:r,showTextControl:o,showSettings:i,textInputRef:l,internalTextInputValue:a,setInternalTextInputValue:s,handleSubmitWithEnter:c,value:u,settings:d,onChange:p}=t;const m=(0,by.Z)(),f=m?v.Fragment:hM.M,h=m?"div":Cw.E.div,g=`link-control-settings-drawer-${(0,dd.Z)(e)}`;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Mo.ZP,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:QL.Z,label:(0,N.__)("Link Settings"),"aria-controls":g}),(0,v.createElement)(f,null,n&&(0,v.createElement)(h,{className:"block-editor-link-control__drawer",hidden:!n,id:g,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1}},(0,v.createElement)("div",{className:"block-editor-link-control__drawer-inner"},o&&(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,ref:l,className:"block-editor-link-control__setting block-editor-link-control__text-content",label:"Text",value:a,onChange:s,onKeyDown:c}),i&&(0,v.createElement)(vM,{value:u,settings:d,onChange:p})))))},yM=n(63162),_M=n.n(yM),kM=(0,Ao.o)((e=>t=>(0,v.createElement)(e,(0,Po.Z)({},t,{speak:fl.D,debouncedSpeak:(0,uh.Z)(fl.D,500)}))),"withSpokenMessages"),xM=n(45675);const wM=(0,Ao.o)((e=>class extends v.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,v.createElement)(e,(0,xM.Z)({},this.props,{setTimeout:this.setTimeout,clearTimeout:this.clearTimeout}))}}),"withSafeTimeout");var CM=wM,EM=(0,Ao.o)((e=>t=>{const n=(0,dd.Z)(e);return(0,v.createElement)(e,(0,xM.Z)({},t,{instanceId:n}))}),"instanceId"),SM=n(9299);function IM(e){return"function"==typeof e}class TM extends v.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,v.createRef)(),this.inputRef=(0,v.createRef)(),this.updateSuggestions=(0,dh.D)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,isUpdatingSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,_M()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===r||this.props.disableSuggestions||this.state.isUpdatingSuggestions||(null!=r&&r.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:r}=this.props;if(!n)return;const o=!(null!==(e=t)&&void 0!==e&&e.length);var i,l;if(t=t.trim(),!o&&(t.length<2||!r&&(0,SM.P)(t)))return null===(i=this.suggestionsRequest)||void 0===i||null===(l=i.cancel)||void 0===l||l.call(i),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:t,selectedSuggestion:null,loading:!1});this.setState({isUpdatingSuggestions:!0,selectedSuggestion:null,loading:!0});const a=n(t,{isInitialSuggestions:o});a.then((e=>{this.suggestionsRequest===a&&(this.setState({suggestions:e,isUpdatingSuggestions:!1,suggestionsValue:t,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,N.sprintf)((0,N._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,N.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===a&&this.setState({isUpdatingSuggestions:!1,loading:!1})})),this.suggestionsRequest=a}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.state.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case Al.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Al.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Al.ENTER:e.preventDefault(),this.props.onSubmit&&this.props.onSubmit(null,e)}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Al.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case Al.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Al.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,N.__)("Link selected.")));break;case Al.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:r,disableSuggestions:o,__experimentalShowInitialSuggestions:i=!1}=e,{showSuggestions:l}=t,a=l;const s=n&&n.length;return i||s||(a=!1),!0===o&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${r}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${r}`}}render(){return(0,v.createElement)(v.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,N.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:a=""}=this.props,{loading:s,showSuggestions:c,selectedSuggestion:u,suggestionsListboxId:d,suggestionOptionIdPrefix:p}=this.state,m=`url-input-control-${o}`,f={id:m,label:t,className:w()("block-editor-url-input",n,{"is-full-width":r})},h={id:m,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,N.__)("URL"),"aria-expanded":c,"aria-autocomplete":"list","aria-owns":d,"aria-activedescendant":null!==u?`${p}-${u}`:void 0,ref:this.inputRef};return l?l(f,h,s):(e||(0,St.default)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,v.createElement)(Xu.ZP,(0,Po.Z)({__nextHasNoMarginBottom:e},f),(0,v.createElement)("input",h),s&&(0,v.createElement)(zw.ZP,null)))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:l,suggestionOptionIdPrefix:a,loading:s}=this.state;if(!n||0===r.length)return null;const c={id:l,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return IM(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:s,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!(null!=o&&o.length),currentInputValue:o}):(0,v.createElement)(T.Z,{placement:"bottom",focusOnMount:!1},(0,v.createElement)("div",(0,Po.Z)({},c,{className:w()("block-editor-url-input__suggestions",`${e}__suggestions`)}),r.map(((e,t)=>(0,v.createElement)(Mo.ZP,(0,Po.Z)({},u(0,t),{key:e.id,className:w()("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)}),e.title)))))}}var NM=(0,hh.Z)(CM,kM,EM,(0,mh.Z)(((e,t)=>{if(IM(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(ku);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(TM),BM=e=>{let t,{searchTerm:n,onClick:r,itemProps:o,isSelected:i,buttonText:l}=e;return n?(t=l?"function"==typeof l?l(n):l:m_((0,N.sprintf)((0,N.__)("Create: %s"),n),{mark:(0,v.createElement)("mark",null)}),(0,v.createElement)(Mo.ZP,(0,Po.Z)({},o,{className:w()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":i}),onClick:r}),(0,v.createElement)(om.Z,{className:"block-editor-link-control__search-item-icon",icon:Tf.Z}),(0,v.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,v.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},LM=n(24782),PM=n(51817);function AM(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}new RegExp(`[${["-","~","­","֊","־","᐀","᠆","‐","‑","‒","–","—","―","⁓","⁻","₋","−","⸗","⸺","⸻","〜","〰","゠","︱","︲","﹘","﹣","-"].join("")}]`,"g");var DM=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,v.createElement)(v.Fragment,null,t);const o=new RegExp(`(${AM(r)})`,"gi");return m_(t.replace(o,"$&"),{mark:(0,v.createElement)("mark",null)})},RM=n(31606),MM=n(64955),OM=n(46945),ZM=n(57114),FM=n(41743),jM=n(57405);const zM={post:RM.Z,page:MM.Z,post_tag:OM.Z,category:ZM.Z,attachment:FM.Z};function HM(e){let{isURL:t,suggestion:n}=e,r=null;return t?r=jM.Z:n.type in zM&&(r=zM[n.type]),r?(0,v.createElement)(om.Z,{className:"block-editor-link-control__search-item-icon",icon:r}):null}var VM=e=>{let{itemProps:t,suggestion:n,isSelected:r=!1,onClick:o,isURL:i=!1,searchTerm:l="",shouldShowType:a=!1}=e;return(0,v.createElement)(Mo.ZP,(0,Po.Z)({},t,{onClick:o,className:w()("block-editor-link-control__search-item",{"is-selected":r,"is-url":i,"is-entity":!i})}),(0,v.createElement)(HM,{suggestion:n,isURL:i}),(0,v.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,v.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,v.createElement)(DM,{text:n.title,highlight:l})),(0,v.createElement)("span",{"aria-hidden":!i,className:"block-editor-link-control__search-item-info"},!i&&((0,LM.w)((0,PM.x)(n.url))||""),i&&(0,N.__)("Press ENTER to add this link"))),a&&n.type&&(0,v.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const WM="__CREATE__",$M="mailto",UM="internal",GM=["URL",$M,"tel",UM],qM=[{id:"opensInNewTab",title:(0,N.__)("Open in new tab")}];function KM(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:r,handleSuggestionClick:o,suggestionsListProps:i,buildSuggestionItemProps:l,suggestions:a,selectedSuggestion:s,isLoading:c,isInitialSuggestions:u,createSuggestionButtonText:d,suggestionsQuery:p}=e;const m=w()("block-editor-link-control__search-results",{"is-loading":c}),f=1===a.length&&GM.includes(a[0].type),h=n&&!f&&!u,g=!(null!=p&&p.type),b=`block-editor-link-control-search-results-label-${t}`,y=u?(0,N.__)("Recently updated"):(0,N.sprintf)((0,N.__)('Search results for "%s"'),r),_=(0,v.createElement)(u?v.Fragment:n_.Z,{},(0,v.createElement)("span",{className:"block-editor-link-control__search-results-label",id:b},y));return(0,v.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},_,(0,v.createElement)("div",(0,Po.Z)({},i,{className:m,"aria-labelledby":b}),a.map(((e,t)=>h&&WM===e.type?(0,v.createElement)(BM,{searchTerm:r,buttonText:d,onClick:()=>o(e),key:e.type,itemProps:l(e,t),isSelected:t===s}):WM===e.type?null:(0,v.createElement)(VM,{key:`${e.id}-${e.type}`,itemProps:l(e,t),suggestion:e,index:t,onClick:()=>{o(e)},isSelected:t===s,isURL:GM.includes(e.type),searchTerm:r,shouldShowType:g,isFrontPage:null==e?void 0:e.isFrontPage})))))}var YM=n(52915),XM=n(34849);function JM(e){const t=null==e?void 0:e.startsWith("#");return(0,SM.P)(e)||e&&e.includes("www.")||t}const QM=()=>Promise.resolve([]),eO=e=>{let t="URL";const n=(0,YM.E)(e)||"";return n.includes("mailto")&&(t=$M),n.includes("tel")&&(t="tel"),null!=e&&e.startsWith("#")&&(t=UM),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,XM.u)(e):e,type:t}])};const tO=()=>Promise.resolve([]),nO=()=>{},rO=(0,v.forwardRef)(((e,t)=>{let{value:n,children:r,currentLink:o={},className:i=null,placeholder:l=null,withCreateSuggestion:a=!1,onCreateSuggestion:s=nO,onChange:c=nO,onSelect:u=nO,showSuggestions:d=!0,renderSuggestions:p=(e=>(0,v.createElement)(KM,e)),fetchSuggestions:m=null,allowDirectEntry:f=!0,showInitialSuggestions:h=!1,suggestionsQuery:g={},withURLSuggestion:b=!0,createSuggestionButtonText:y,useLabel:_=!1}=e;const k=function(e,t,n,r){const{fetchSearchSuggestions:o,pageOnFront:i}=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),l=t?eO:QM;return(0,v.useCallback)(((t,a)=>{let{isInitialSuggestions:s}=a;return JM(t)?l(t,{isInitialSuggestions:s}):(async(e,t,n,r,o,i,l)=>{const{isInitialSuggestions:a}=t;let s=!1,c=await Promise.all([n(e,t),r(e)]);c[0]=c[0].map((e=>Number(e.id)===l?(s=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!s&&u&&i&&!a?c[0].concat(c[1]):c[0],a||JM(e)||!o?c:c.concat({title:e,url:e,type:WM})})(t,{...e,isInitialSuggestions:s},o,l,n,r,i)}),[l,o,n])}(g,f,a,b),x=d?m||k:tO,C=(0,dd.Z)(rO),[S,I]=(0,v.useState)(),T=async e=>{let t=e;if(WM!==e.type){if(f||t&&Object.keys(t).length>=1){const{id:e,url:n,...r}=null!=o?o:{};u({...r,...t},t)}}else try{var n;t=await s(e.title),null!==(n=t)&&void 0!==n&&n.url&&u(t)}catch(e){}},B=w()(i,{"has-no-label":!_});return(0,v.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,v.createElement)(NM,{__nextHasNoMarginBottom:!0,label:_?"URL":void 0,className:B,value:n,onChange:(e,t)=>{c(e),I(t)},placeholder:null!=l?l:(0,N.__)("Search or type url"),__experimentalRenderSuggestions:d?e=>p({...e,instanceId:C,withCreateSuggestion:a,createSuggestionButtonText:y,suggestionsQuery:g,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),T(t)}}):null,__experimentalFetchLinkSuggestions:x,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,onSubmit:(e,t)=>{var r;const o=e||S;o||null!=n&&null!==(r=n.trim())&&void 0!==r&&r.length?T(o||{url:n}):t.preventDefault()},ref:t}),r)}));var oO=rO,iO=n(25948),lO=n(76731);const{Slot:aO,Fill:sO}=(0,I.up)("BlockEditorLinkControlViewer");function cO(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function uO(e){var t;let{value:n,onEditClick:r,hasRichPreviews:o=!1,hasUnlinkControl:i=!1,onRemove:l}=e;const a=o?null==n?void 0:n.url:null,{richData:s,isFetching:c}=function(e){const[t,n]=(0,v.useReducer)(cO,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,v.useEffect)((()=>{if(null!=e&&e.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(a),u=s&&Object.keys(s).length,d=n&&(0,LM.w)((0,PM.x)(n.url),16)||"",p=(null==s?void 0:s.title)||(null==n?void 0:n.title)||d,m=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let f;return f=null!=s&&s.icon?(0,v.createElement)("img",{src:null==s?void 0:s.icon,alt:""}):m?(0,v.createElement)(om.Z,{icon:iO.Z,size:32}):(0,v.createElement)(om.Z,{icon:jM.Z}),(0,v.createElement)("div",{"aria-label":(0,N.__)("Currently selected"),className:w()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":m})},(0,v.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,v.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,v.createElement)("span",{className:w()("block-editor-link-control__search-item-icon",{"is-image":null==s?void 0:s.icon})},f),(0,v.createElement)("span",{className:"block-editor-link-control__search-item-details"},m?(0,v.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,N.__)("Link is empty")):(0,v.createElement)(v.Fragment,null,(0,v.createElement)(df.Z,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Y.Z)(p)),(null==n?void 0:n.url)&&(0,v.createElement)("span",{className:"block-editor-link-control__search-item-info"},d)))),(0,v.createElement)(Mo.ZP,{icon:lO.Z,label:(0,N.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:r,iconSize:24}),i&&(0,v.createElement)(Mo.ZP,{icon:oT.Z,label:(0,N.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,v.createElement)(aO,{fillProps:n})),!!(u&&(null!=s&&s.image||null!=s&&s.description)||c)&&(0,v.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==s?void 0:s.image)||c)&&(0,v.createElement)("div",{"aria-hidden":!(null!=s&&s.image),className:w()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=s&&s.image)})},(null==s?void 0:s.image)&&(0,v.createElement)("img",{src:null==s?void 0:s.image,alt:""})),((null==s?void 0:s.description)||c)&&(0,v.createElement)("div",{"aria-hidden":!(null!=s&&s.description),className:w()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=s&&s.description)})},(null==s?void 0:s.description)&&(0,v.createElement)(yE.Z,{truncate:!0,numberOfLines:"2"},s.description))))}function dO(e){const[t,n]=(0,v.useState)(e||"");return(0,v.useEffect)((()=>{e&&e!==t&&n(e)}),[e]),[t,n]}const pO=()=>{};function mO(e){var t,n,r;let{searchInputPlaceholder:o,value:i,settings:l=qM,onChange:a=pO,onRemove:s,onCancel:c,noDirectEntry:u=!1,showSuggestions:d=!0,showInitialSuggestions:p,forceIsEditingLink:m,createSuggestion:f,withCreateSuggestion:h,inputValue:g="",suggestionsQuery:b={},noURLSuggestion:y=!1,createSuggestionButtonText:_,hasRichPreviews:k=!1,hasTextControl:x=!1,renderControlBottom:C=null}=e;void 0===h&&f&&(h=!0);const E=(0,v.useRef)(!0),S=(0,v.useRef)(),I=(0,v.useRef)(),T=(0,v.useRef)(!1),[B,L]=(0,v.useState)(!1),[P,A]=dO((null==i?void 0:i.url)||""),[D,R]=dO((null==i?void 0:i.title)||""),[M,O]=(0,v.useState)(void 0!==m?m:!i||!i.url),{createPage:Z,isCreatingPage:F,errorMessage:j}=function(e){const t=(0,v.useRef)(),[n,r]=(0,v.useState)(!1),[o,i]=(0,v.useState)(null);return(0,v.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,N.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(f);(0,v.useEffect)((()=>{void 0!==m&&m!==M&&O(m)}),[m]),(0,v.useEffect)((()=>{if(E.current)return void(E.current=!1);const e=null!=I&&I.current?1:0;(wy.focus.focusable.find(S.current)[e]||S.current).focus(),T.current=!1}),[M,F]);const z=(null==i||null===(t=i.url)||void 0===t||null===(n=t.trim())||void 0===n?void 0:n.length)>0,H=()=>{var e;T.current=!(null===(e=S.current)||void 0===e||!e.contains(S.current.ownerDocument.activeElement)),L(!1),O(!1)},V=()=>{W===(null==i?void 0:i.url)&&D===(null==i?void 0:i.title)||a({...i,url:W,title:D}),H()},W=g||P,$=!(null!=W&&null!==(r=W.trim())&&void 0!==r&&r.length),U=s&&i&&!M&&!F,G=!(null==l||!l.length),q=z&&x,K=(M||!i)&&!F;return(0,v.createElement)("div",{tabIndex:-1,ref:S,className:"block-editor-link-control"},F&&(0,v.createElement)("div",{className:"block-editor-link-control__loading"},(0,v.createElement)(zw.ZP,null)," ",(0,N.__)("Creating"),"…"),K&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)("div",{className:w()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":q})},(0,v.createElement)(oO,{currentLink:i,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:o,value:W,withCreateSuggestion:h,onCreateSuggestion:Z,onChange:A,onSelect:e=>{a({...e,title:D||(null==e?void 0:e.title)}),H()},showInitialSuggestions:p,allowDirectEntry:!u,showSuggestions:d,suggestionsQuery:b,withURLSuggestion:!y,createSuggestionButtonText:_,useLabel:q})),j&&(0,v.createElement)(DL.Z,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},j)),i&&!M&&!F&&(0,v.createElement)(uO,{key:null==i?void 0:i.url,value:i,onEditClick:()=>O(!0),hasRichPreviews:k,hasUnlinkControl:U,onRemove:s}),K&&(0,v.createElement)("div",{className:"block-editor-link-control__tools"},(G||q)&&(0,v.createElement)(bM,{settingsOpen:B,setSettingsOpen:L,showTextControl:q,showSettings:G,textInputRef:I,internalTextInputValue:D,setInternalTextInputValue:R,handleSubmitWithEnter:e=>{const{keyCode:t}=e;t!==Al.ENTER||$||(e.preventDefault(),V())},value:i,settings:l,onChange:a}),(0,v.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,v.createElement)(Mo.ZP,{variant:"primary",onClick:V,className:"xblock-editor-link-control__search-submit",disabled:$},(0,N.__)("Apply")),(0,v.createElement)(Mo.ZP,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),A(null==i?void 0:i.url),R(null==i?void 0:i.title),z?H():null==s||s(),null==c||c()}},(0,N.__)("Cancel")))),C&&C())}mO.ViewerFill=sO;var fO=mO,hO=function(e){let{accept:t,children:n,multiple:r=!1,onChange:o,onClick:i,render:l,...a}=e;const s=(0,v.useRef)(null),c=()=>{var e;null===(e=s.current)||void 0===e||e.click()},u=l?l({openFileDialog:c}):(0,v.createElement)(Mo.ZP,(0,Po.Z)({onClick:c},a),n);return(0,v.createElement)("div",{className:"components-form-file-upload"},u,(0,v.createElement)("input",{type:"file",ref:s,multiple:r,style:{display:"none"},accept:t,onChange:o,onClick:i,"data-testid":"form-file-upload-input"}))},gO=n(64446),vO=n(2787),bO=n(50934);const yO=()=>{};let _O=0;var kO=(0,hh.Z)([(0,fh.Z)((e=>{const{createNotice:t,removeNotice:n}=e(Px.h);return{createNotice:t,removeNotice:n}})),ph("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:r,allowedTypes:o,accept:i,onError:l,onSelect:a,onSelectURL:s,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:d=yO,name:p=(0,N.__)("Replace"),createNotice:m,removeNotice:f,children:h,multiple:g=!1,addToGallery:b,handleUpload:y=!0}=e;const _=(0,E.Z)((e=>e(ku).getSettings().mediaUpload),[]),k=(0,v.useRef)(),x="block-editor/media-replace-flow/error-notice/"+ ++_O,w=e=>{const t=(0,Y.Z)(e);l?l(t):setTimeout((()=>{m("error",t,{speak:!0,id:x,isDismissible:!0})}),1e3)},C=(e,t)=>{u&&c&&c(),t(),a(e),(0,fl.D)((0,N.__)("The media file has been replaced")),f(x)},S=e=>{e.keyCode===Al.DOWN&&(e.preventDefault(),e.target.click())},I=g&&!(!o||0===o.length)&&o.every((e=>"image"===e||e.startsWith("image/")));return(0,v.createElement)(t_.Z,{popoverProps:{variant:"toolbar"},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,v.createElement)(Fo,{ref:k,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:S},p)},renderContent:e=>{let{onClose:l}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(oE.Z,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,v.createElement)(v.Fragment,null,(0,v.createElement)(tC,{gallery:I,addToGallery:b,multiple:g,value:g?r:n,onSelect:e=>C(e,l),allowedTypes:o,render:e=>{let{open:t}=e;return(0,v.createElement)(Zu.Z,{icon:gO.Z,onClick:t},(0,N.__)("Open Media Library"))}}),(0,v.createElement)(eC,null,(0,v.createElement)(hO,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),a(n);d(n),_({allowedTypes:o,filesList:n,onFileChange:e=>{let[n]=e;C(n,t)},onError:w})})(e,l)},accept:i,multiple:g,render:e=>{let{openFileDialog:t}=e;return(0,v.createElement)(Zu.Z,{icon:vO.Z,onClick:()=>{t()}},(0,N.__)("Upload"))}}))),c&&(0,v.createElement)(Zu.Z,{icon:bO.Z,onClick:c,isPressed:u},(0,N.__)("Use featured image")),h),s&&(0,v.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,v.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,N.__)("Current media URL:")),(0,v.createElement)(Ld.Z,{text:t,position:"bottom"},(0,v.createElement)("div",null,(0,v.createElement)(fO,{value:{url:t},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;s(t),k.current.focus()}})))))}})})),xO=function(e){let{className:t,label:n,onFilesDrop:r,onHTMLDrop:o,onDrop:i,...l}=e;const[a,s]=(0,v.useState)(),[c,u]=(0,v.useState)(),[d,p]=(0,v.useState)(),m=wI({onDrop(e){var t;const n=e.dataTransfer?(0,CI.f)(e.dataTransfer):[],l=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("text/html");l&&o?o(l):n.length&&r?r(n):i&&i(e)},onDragStart(e){var t,n;s(!0);let r="default";null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("text/html")?r="html":(null!==(n=e.dataTransfer)&&void 0!==n&&n.types.includes("Files")||(e.dataTransfer?(0,CI.f)(e.dataTransfer):[]).length>0)&&(r="file"),p(r)},onDragEnd(){s(!1),p(void 0)},onDragEnter(){u(!0)},onDragLeave(){u(!1)}}),f=(0,by.Z)();let h;c&&(h=(0,v.createElement)(Cw.E.div,{variants:{hidden:{scaleY:0,opacity:0},show:{scaleY:1,opacity:1,transition:{type:"tween",duration:.2,delay:.1,delayChildren:.2}},exit:{scaleY:1,opacity:0,transition:{duration:.3,delayChildren:0}}},initial:f?"show":"hidden",animate:"show",exit:f?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"}},(0,v.createElement)(Cw.E.div,{variants:{hidden:{opacity:0,scale:.75},show:{opacity:1,scale:1},exit:{opacity:0,scale:.9}}},(0,v.createElement)(om.Z,{icon:vO.Z,className:"components-drop-zone__content-icon"}),(0,v.createElement)("span",{className:"components-drop-zone__content-text"},n||(0,N.__)("Drop files to upload")))));const g=w()("components-drop-zone",t,{"is-active":(a||c)&&("file"===d&&r||"html"===d&&o||"default"===d&&i),"is-dragging-over-document":a,"is-dragging-over-element":c,[`is-dragging-${d}`]:!!d});return(0,v.createElement)("div",(0,Po.Z)({},l,{ref:m,className:g}),f?h:(0,v.createElement)(hM.M,null,h))},wO=n(98616);function CO(e){let{url:t,urlLabel:n,className:r}=e;const o=w()(r,"block-editor-url-popover__link-viewer-url");return t?(0,v.createElement)(df.Z,{className:o,href:t},n||(0,LM.w)((0,PM.x)(t))):(0,v.createElement)("span",{className:o})}const{__experimentalPopoverLegacyPositionToPlacement:EO}=yu(US);function SO(e){let t,{additionalControls:n,children:r,renderSettings:o,placement:i,focusOnMount:l="firstElement",position:a,...s}=e;void 0!==a&&(0,St.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==i?t=i:void 0!==a&&(t=EO(a)),t=t||"bottom";const[c,u]=(0,v.useState)(!1),d=!!o&&c;return(0,v.createElement)(T.Z,(0,Po.Z)({className:"block-editor-url-popover",focusOnMount:l,placement:t,shift:!0},s),(0,v.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,v.createElement)("div",{className:"block-editor-url-popover__row"},r,!!o&&(0,v.createElement)(Mo.ZP,{className:"block-editor-url-popover__settings-toggle",icon:VC.Z,label:(0,N.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,v.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),n&&!d&&(0,v.createElement)("div",{className:"block-editor-url-popover__additional-controls"},n))}SO.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:r,value:o,...i}=e;return(0,v.createElement)("form",(0,Po.Z)({className:w()("block-editor-url-popover__link-editor",n)},i),(0,v.createElement)(NM,{__nextHasNoMarginBottom:!0,value:o,onChange:r,autocompleteRef:t}),(0,v.createElement)(Mo.ZP,{icon:wO.Z,label:(0,N.__)("Apply"),type:"submit"}))},SO.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:r,url:o,urlLabel:i,...l}=e;return(0,v.createElement)("div",(0,Po.Z)({className:w()("block-editor-url-popover__link-viewer",t)},l),(0,v.createElement)(CO,{url:o,urlLabel:i,className:n}),r&&(0,v.createElement)(Mo.ZP,{icon:lO.Z,label:(0,N.__)("Edit"),onClick:r}))};var IO=SO;const TO=()=>{},NO=e=>{let{src:t,onChange:n,onSubmit:r,onClose:o}=e;return(0,v.createElement)(IO,{onClose:o},(0,v.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:r},(0,v.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,N.__)("URL"),placeholder:(0,N.__)("Paste or type URL"),onChange:n,value:t}),(0,v.createElement)(Mo.ZP,{className:"block-editor-media-placeholder__url-input-submit-button",icon:wO.Z,label:(0,N.__)("Apply"),type:"submit"})))};var BO=ph("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:r,icon:o,labels:i={},mediaPreview:l,notices:a,isAppender:s,accept:c,addToGallery:u,multiple:d=!1,handleUpload:p=!0,disableDropZone:m,disableMediaButtons:f,onError:h,onSelect:g,onCancel:b,onSelectURL:y,onToggleFeaturedImage:_,onDoubleClick:k,onFilesPreUpload:x=TO,onHTMLDrop:C=TO,children:S,mediaLibraryButton:I,placeholder:T,style:B}=e;const L=(0,E.Z)((e=>{const{getSettings:t}=e(ku);return t().mediaUpload}),[]),[P,A]=(0,v.useState)(""),[D,R]=(0,v.useState)(!1);(0,v.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const M=e=>{A(e.target.value)},O=()=>{R(!0)},Z=()=>{R(!1)},F=e=>{e.preventDefault(),P&&y&&(y(P),Z())},j=e=>{if(!p)return g(e);let r;if(x(e),d)if(u){let e=[];r=n=>{const r=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));g(r.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=g;else r=e=>{let[t]=e;return g(t)};L({allowedTypes:n,filesList:e,onFileChange:r,onError:h})},z=e=>{j(e.target.files)},H=null!=T?T:e=>{let{instructions:t,title:c}=i;if(L||y||(t=(0,N.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===c){const e=null!=n?n:[],[r]=e,o=1===e.length,i=o&&"audio"===r,l=o&&"image"===r,a=o&&"video"===r;void 0===t&&L&&(t=(0,N.__)("Upload a media file or pick one from your media library."),i?t=(0,N.__)("Upload an audio file, pick one from your media library, or add one with a URL."):l?t=(0,N.__)("Upload an image file, pick one from your media library, or add one with a URL."):a&&(t=(0,N.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,N.__)("Media"),i?c=(0,N.__)("Audio"):l?c=(0,N.__)("Image"):a&&(c=(0,N.__)("Video")))}const u=w()("block-editor-media-placeholder",r,{"is-appender":s});return(0,v.createElement)(NR,{icon:o,label:c,instructions:t,className:u,notices:a,onDoubleClick:k,preview:l,style:B},e,S)},V=()=>m?null:(0,v.createElement)(xO,{onFilesDrop:j,onHTMLDrop:C}),W=()=>b&&(0,v.createElement)(Mo.ZP,{className:"block-editor-media-placeholder__cancel-button",title:(0,N.__)("Cancel"),variant:"link",onClick:b},(0,N.__)("Cancel")),$=()=>y&&(0,v.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,v.createElement)(Mo.ZP,{className:"block-editor-media-placeholder__button",onClick:O,isPressed:D,variant:"tertiary"},(0,N.__)("Insert from URL")),D&&(0,v.createElement)(NO,{src:P,onChange:M,onSubmit:F,onClose:Z})),U=()=>_&&(0,v.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,v.createElement)(Mo.ZP,{className:"block-editor-media-placeholder__button",onClick:_,variant:"tertiary"},(0,N.__)("Use featured image")));return f?(0,v.createElement)(eC,null,V()):(0,v.createElement)(eC,{fallback:H($())},(()=>{const e=null!=I?I:e=>{let{open:t}=e;return(0,v.createElement)(Mo.ZP,{variant:"tertiary",onClick:()=>{t()}},(0,N.__)("Media Library"))},r=(0,v.createElement)(tC,{addToGallery:u,gallery:d&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:d,onSelect:g,allowedTypes:n,mode:"browse",value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(L&&s)return(0,v.createElement)(v.Fragment,null,V(),(0,v.createElement)(hO,{onChange:z,accept:c,multiple:d,render:e=>{let{openFileDialog:t}=e;const n=(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Mo.ZP,{variant:"primary",className:w()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,N.__)("Upload")),r,$(),U(),W());return H(n)}}));if(L){const e=(0,v.createElement)(v.Fragment,null,V(),(0,v.createElement)(hO,{variant:"primary",className:w()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:z,accept:c,multiple:d},(0,N.__)("Upload")),r,$(),U(),W());return H(e)}return H(r)})())}));function LO(e){const t=e.useItems?e.useItems:function(e){return t=>{const[n,r]=(0,v.useState)([]);return(0,v.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,dh.D)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),l=new RegExp("(?:\\b|\\s|^)"+AM(t),"i");r(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=[];for(let o=0;oe.test(Qe()(t))))&&(r.push(i),r.length===n))break}return r}(l,i))}));return o}),o?250:0),l=i();return()=>{i.cancel(),l&&(l.canceled=!0)}}),[t]),[n]}}(e);return function(e){let{filterValue:n,instanceId:r,listBoxId:o,className:i,selectedIndex:l,onChangeOptions:a,onSelect:s,onReset:c,reset:u,value:d,contentRef:p}=e;const[m]=t(n),f=gl({editableContentElement:p.current,value:d}),[h,g]=(0,v.useState)(!1),y=(0,v.useRef)(),_=(0,vl.Z)([y,(0,bl.Z)((e=>{p.current&&g(e.ownerDocument!==p.current.ownerDocument)}),[p])]);var k,x;if(k=y,x=u,(0,v.useEffect)((()=>{const e=e=>{k.current&&!k.current.contains(e.target)&&x(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[x]),(0,v.useLayoutEffect)((()=>{a(m)}),[m]),!m.length>0)return null;const C=e=>{let{Component:t="div"}=e;return(0,v.createElement)(t,{id:o,role:"listbox",className:"components-autocomplete__results"},m.map(((e,t)=>(0,v.createElement)(Mo.ZP,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===l,disabled:e.isDisabled,className:w()("components-autocomplete__result",i,{"is-selected":t===l}),onClick:()=>s(e)},e.label))))};return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(T.Z,{focusOnMount:!1,onClose:c,placement:"top-start",className:"components-autocomplete__popover",anchor:f,ref:_},(0,v.createElement)(C,null)),p.current&&h&&(0,b.createPortal)((0,v.createElement)(C,{Component:n_.Z}),p.current.ownerDocument.body))}}const PO=[];function AO(e){let{record:t,onChange:n,onReplace:r,completers:o,contentRef:i}=e;const l=(0,uh.Z)(fl.D,500),a=(0,dd.Z)(AO),[s,c]=(0,v.useState)(0),[u,d]=(0,v.useState)(PO),[p,m]=(0,v.useState)(""),[f,h]=(0,v.useState)(null),[g,b]=(0,v.useState)(null),y=(0,v.useRef)(!1);function _(e){const{getOptionCompletion:o}=f||{};if(!e.isDisabled){if(o){const i=o(e.value,p),{action:l,value:a}=void 0===i.action||void 0===i.value?{action:"insert-at-caret",value:i}:i;if("replace"===l)return void r([a]);"insert-at-caret"===l&&function(e){const r=t.start,o=r-f.triggerPrefix.length-p.length,i=Ii({html:(0,mn.ZP)(e)});n(Ui(t,i,o,r))}(a)}k()}}function k(){c(0),d(PO),m(""),h(null),b(null)}const x=(0,v.useMemo)((()=>{if(ji(t))return Fi(Ki(t,0))}),[t]);(0,v.useEffect)((()=>{if(!x)return void(f&&k());const e=null==o?void 0:o.find((e=>{let{triggerPrefix:n,allowContext:r}=e;const o=x.lastIndexOf(n);if(-1===o)return!1;const i=x.slice(o+n.length);if(i.length>50)return!1;const l=0===u.length,a=1===i.split(/\s/).length,s=y.current&&i.split(/\s/).length<=3;if(l&&!s&&!a)return!1;const c=Fi(Ki(t,void 0,Fi(t).length));return!(r&&!r(x.slice(0,o),c))&&!/^\s/.test(i)&&!/\s\s+$/.test(i)&&/[\u0000-\uFFFF]*$/.test(i)}));if(!e)return void(f&&k());const n=AM(e.triggerPrefix),r=Qe()(x),i=r.slice(r.lastIndexOf(e.triggerPrefix)).match(new RegExp(`${n}([\0-￿]*)$`)),l=i&&i[1];h(e),b((()=>e!==f?LO(e):g)),m(l)}),[x]);const{key:w=""}=u[s]||{},{className:C}=f||{},E=!!f&&u.length>0,S=E?`components-autocomplete-listbox-${a}`:null;return{listBoxId:S,activeId:E?`components-autocomplete-item-${a}-${w}`:null,onKeyDown:function(e){if(y.current="Backspace"===e.key,f&&0!==u.length&&!e.defaultPrevented&&!e.isComposing&&229!==e.keyCode){switch(e.key){case"ArrowUp":c((0===s?u.length:s)-1);break;case"ArrowDown":c((s+1)%u.length);break;case"Escape":h(null),b(null),e.preventDefault();break;case"Enter":_(u[s]);break;case"ArrowLeft":case"ArrowRight":return void k();default:return}e.preventDefault()}},popover:void 0!==t.start&&g&&(0,v.createElement)(g,{className:C,filterValue:p,instanceId:a,listBoxId:S,selectedIndex:s,onChangeOptions:function(e){c(e.length===u.length?s:0),d(e),function(e){l&&(e.length?l((0,N.sprintf)((0,N._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):l((0,N.__)("No results."),"assertive"))}(e)},onSelect:_,value:t,contentRef:i,reset:k})}}const DO=()=>{};var RO={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,E.Z)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:r}=e(ku),o=t();return{selectedBlockName:o?n(o):null,rootClientId:r().rootClientId}}),[]),[r,o,i]=cx(t,DO),l=(0,v.useMemo)((()=>(e.trim()?tw(r,o,i,e):Wl(r,"frecency","desc")).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,o,i]),a=(0,v.useMemo)((()=>l.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(k_,{key:"icon",icon:n,showColors:!0}),t),isDisabled:r}}))),[l]);return[a]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r}=e;return{action:"replace",value:ke(t,n,xe(r))}}},MO=n(26426),OO={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,y.default)({path:(0,Ow.f)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,v.createElement)(v.Fragment,null,(0,v.createElement)(om.Z,{key:"icon",icon:"page"===e.subtype?MM.Z:MO.Z}),e.title),getOptionCompletion:e=>(0,v.createElement)("a",{href:e.url},e.title)};const ZO=[];function FO(e){let{completers:t=ZO}=e;const{name:n}=Su();return(0,v.useMemo)((()=>{let e=[...t,OO];return(n===de()||fe(n,"__experimentalSlashInserter",!1))&&(e=[...e,RO]),(0,_e.H7)("editor.Autocomplete.completers")&&(e===t&&(e=e.map((e=>({...e})))),e=(0,_e.O)("editor.Autocomplete.completers",e,n)),e}),[t,n])}const jO={position:"bottom right",variant:"toolbar"};var zO=()=>(0,v.createElement)(v.Fragment,null,["bold","italic","link","unknown"].map((e=>(0,v.createElement)(I.g7,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,v.createElement)(I.g7,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})),n=t.some((e=>{let{isActive:t}=e;return t}));return(0,v.createElement)(Oo.Z,null,(t=>(0,v.createElement)(zo.Z,{icon:VC.Z,label:(0,N.__)("More"),toggleProps:{...t,className:w()(t.className,{"is-pressed":n}),describedBy:(0,N.__)("Displays more block tools")},controls:Wl(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:jO})))})));function HO(e){let{value:t,editableContentElement:n,activeFormats:r}=e;const o=r[r.length-1],i=null==o?void 0:o.type,l=gl({editableContentElement:n,value:t,settings:(0,E.Z)((e=>e(bi).getFormatType(i)),[i])});return(0,v.createElement)(VO,{popoverAnchor:l})}function VO(e){let{popoverAnchor:t}=e;return(0,v.createElement)(T.Z,{placement:"top",focusOnMount:!1,anchor:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,v.createElement)(lE,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,N.__)("Format tools")},(0,v.createElement)(Vo,null,(0,v.createElement)(zO,null))))}var WO=e=>{let{inline:t,editableContentElement:n,value:r}=e;const o=(0,E.Z)((e=>e(ku).getSettings().hasInlineToolbar),[]);if(t)return(0,v.createElement)(VO,{popoverAnchor:n});if(o){const e=Mi(r);return ji(r)&&!e.length?null:(0,v.createElement)(HO,{editableContentElement:n,value:r,activeFormats:e})}return(0,v.createElement)(Ru,{group:"inline"},(0,v.createElement)(zO,null))};function $O(){const{didAutomaticChange:e,getSettings:t}=(0,E.Z)(ku);return(0,bl.Z)((n=>{function r(n){const{keyCode:r}=n;if(n.defaultPrevented)return;if(r!==Al.DELETE&&r!==Al.BACKSPACE&&r!==Al.ESCAPE)return;const{__experimentalUndo:o}=t();o&&e()&&(n.preventDefault(),o())}return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}),[])}function UO(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function GO(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function qO(e){let{allowedFormats:t,disableFormats:n}=e;return n?qO.EMPTY_ARRAY:t}function KO(e){let{value:t,pastedBlocks:n=[],onReplace:r,onSplit:o,onSplitMiddle:i,multilineTag:l}=e;if(!r||!o)return;const{start:a=0,end:s=0}=t,c={...t,start:a,end:s},u=[],[d,p]=Yi(c),m=n.length>0;let f=-1;const h=zi(d)&&!zi(p);m&&zi(d)||(u.push(o(rl({value:d,multilineTag:l}),!h)),f+=1),m?(u.push(...n),f+=n.length):i&&u.push(i()),(m||i)&&zi(p)||u.push(o(rl({value:p,multilineTag:l}),h)),r(u,m?f:1,m?-1:0)}function YO(e,t){return t?qi(e,/\n+/g,Ci):qi(e,new RegExp(Ci,"g"),"\n")}function XO(e){const t=(0,v.useRef)(e);return t.current=e,(0,bl.Z)((e=>{function n(e){const{isSelected:n,disableFormats:r,onChange:o,value:i,formatTypes:l,tagName:a,onReplace:s,onSplit:c,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:p,preserveWhiteSpace:m,pastePlainText:f}=t.current;if(!n)return;const{clipboardData:h}=e;let g="",v="";try{g=h.getData("text/plain"),v=h.getData("text/html")}catch(e){try{v=h.getData("Text")}catch(e){return}}if(v=function(e){const t="\x3c!--StartFragment--\x3e",n=e.indexOf(t);if(!(n>-1))return e;const r=(e=e.substring(n+t.length)).indexOf("\x3c!--EndFragment--\x3e");return r>-1&&(e=e.substring(0,r)),e}(v),v=function(e){const t="";return e.startsWith(t)?e.slice(t.length):e}(v),e.preventDefault(),window.console.log("Received HTML:\n\n",v),window.console.log("Received plain text:\n\n",g),r)return void o(Ui(i,g));const b=l.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:v,plainText:g})),e}),i);if(b!==i)return void o(b);const y=[...(0,CI.f)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=Ii({html:v,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:m});return t=YO(t,!!p),UO(t,i.activeFormats),void o(Ui(i,t))}if(f)return void o(Ui(i,Ii({text:g})));if(null!=y&&y.length&&window.console.log("Received items:\n\n",y),null!=y&&y.length&&!function(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const r=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(r))return!0}return!1}(y,v)){const e=Be("from"),t=y.reduce(((t,n)=>{const r=Ne(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat();if(!t.length)return;return void(s&&zi(i)?s(t):KO({value:i,pastedBlocks:t,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}let _=s&&c?"AUTO":"INLINE";var k;"AUTO"===_&&zi(i)&&(k=g,Ur(".*").test(k))&&(_="BLOCKS"),d&&zi(i)&&(0,SM.P)(g.trim())&&(_="BLOCKS");const x=No({HTML:v,plainText:g,mode:_,tagName:a,preserveWhiteSpace:m});if("string"==typeof x){let e=Ii({html:x});e=YO(e,!!p),UO(e,i.activeFormats),o(Ui(i,e))}else x.length>0&&(s&&zi(i)?s(x,x.length-1,-1):KO({value:i,pastedBlocks:x,onReplace:s,onSplit:c,onSplitMiddle:u,multilineTag:p}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}qO.EMPTY_ARRAY=[];const JO=["`",'"',"'","“”","‘’"];function QO(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,S.Z)(ku),r=(0,v.useRef)(e);return r.current=e,(0,bl.Z)((e=>{function o(o){const{inputType:i,data:l}=o,{value:a,onChange:s}=r.current;if("insertText"!==i)return;if(ji(a))return;const c=(0,_e.O)("blockEditor.wrapSelectionSettings",JO).find((e=>{let[t,n]=e;return t===l||n===l}));if(!c)return;const[u,d=u]=c,p=a.start,m=a.end+u.length;let f=Ui(a,u,p,p);f=Ui(f,d,m,m),t(),s(f),n();const h={};for(const e in o)h[e]=o[e];h.data=d;const{ownerDocument:g}=e,{defaultView:v}=g,b=new v.InputEvent("input",h);window.queueMicrotask((()=>{o.target.dispatchEvent(b)})),o.preventDefault()}return e.addEventListener("beforeinput",o),()=>{e.removeEventListener("beforeinput",o)}}),[])}function eZ(e){let t=e.length;for(;t--;){const n=sc(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].replace(ac,""),[e[t].clientId,n,0,0];const r=eZ(e[t].innerBlocks);if(r)return r}return[]}function tZ(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,S.Z)(ku),r=(0,v.useRef)(e);return r.current=e,(0,bl.Z)((e=>{function o(){const{getValue:e,onReplace:t,selectionChange:o}=r.current;if(!t)return;const i=e(),{start:l,text:a}=i;if(" "!==a.slice(l-1,l))return;const s=a.slice(0,l).trim(),c=Be("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=Ne(c,(e=>{let{prefix:t}=e;return s===t}));if(!u)return;const d=rl({value:Ui(i,ac,0,l)}),p=u.transform(d);return o(...eZ([p])),t([p]),n(),!0}function i(e){const{inputType:i,type:l}=e,{getValue:a,onChange:s,__unstableAllowPrefixTransformations:c,formatTypes:u}=r.current;if("insertText"!==i&&"compositionend"!==l)return;if(c&&o&&o())return;const d=a(),p=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:r}=e;return n{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function nZ(e){const t=(0,v.useRef)(e);return t.current=e,(0,bl.Z)((e=>{function n(e){const{keyCode:n}=e;if(e.defaultPrevented)return;const{value:r,onMerge:o,onRemove:i}=t.current;if(n===Al.DELETE||n===Al.BACKSPACE){const{start:t,end:l,text:a}=r,s=n===Al.BACKSPACE,c=r.activeFormats&&!!r.activeFormats.length;if(!ji(r)||c||s&&0!==t||!s&&l!==a.length)return;o&&o(!s),i&&zi(r)&&s&&i(!s),e.preventDefault()}}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n)}}),[])}function rZ(e){const{__unstableMarkAutomaticChange:t}=(0,S.Z)(ku),n=(0,v.useRef)(e);return n.current=e,(0,bl.Z)((e=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Al.ENTER)return;const{removeEditorOnlyFormats:r,value:o,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s,onChange:c,disableLineBreaks:u,onSplitAtEnd:d}=n.current;e.preventDefault();const p={...o};p.formats=r(o);const m=i&&l;if(i){const e=Be("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=Ne(e,(e=>e.regExp.test(p.text)));n&&(i([n.transform({content:p.text})]),t())}if(s)e.shiftKey?u||c(Ui(p,"\n")):m&&Hi(p)?KO({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s}):c(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end;const r=e.text.slice(0,t).lastIndexOf(Ci),o=e.replacements[r];let i=[,];return o&&(i=[o]),Ui(e,{formats:[,],replacements:i,text:Ci},t,n)}(p));else{const{text:t,start:n,end:r}=p,o=d&&n===r&&r===t.length;e.shiftKey||!m&&!o?u||c(Ui(p,"\n")):!m&&o?d():m&&KO({value:p,onReplace:i,onSplit:l,onSplitMiddle:a,multilineTag:s})}}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function oZ(e){return e(bi).getFormatTypes()}const iZ=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function lZ(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;return[`${t}.${n}`,r]})))}function aZ(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,r)=>(n[r.slice(t.length+1)]=e[r],n)),{})}function sZ(e){return(0,bl.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function cZ(e){return(0,bl.Z)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function uZ(){const{__unstableMarkLastChangeAsPersistent:e}=(0,S.Z)(ku);return(0,bl.Z)((t=>{function n(t){"insertReplacementText"===t.inputType&&e()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}}),[])}function dZ(){const{isMultiSelecting:e}=(0,E.Z)(ku);return(0,bl.Z)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function pZ(e){let{formatTypes:t,onChange:n,onFocus:r,value:o,forwardedRef:i}=e;return t.map((e=>{const{name:t,edit:l}=e;if(!l)return null;const a=Oi(o,t);let s=void 0!==a;const c=function(e){let{start:t,end:n,replacements:r,text:o}=e;if(t+1===n&&o[t]===Ei)return r[t]}(o),u=void 0!==c&&c.type===t;if("core/link"===t&&!ji(o)){var d,p;const e=o.formats,t=null===(d=e[o.start])||void 0===d?void 0:d.find((e=>{let{type:t}=e;return"core/link"===t})),n=null===(p=e[o.end-1])||void 0===p?void 0:p.find((e=>{let{type:t}=e;return"core/link"===t}));t&&n&&t===n||(s=!1)}return(0,v.createElement)(l,{key:t,isActive:s,activeAttributes:s&&a.attributes||{},isObjectActive:u,activeObjectAttributes:u&&c.attributes||{},value:o,onChange:n,onFocus:r,contentRef:i})}))}const mZ=(0,v.createContext)(),fZ=(0,v.createContext)(),hZ=(0,v.forwardRef)((function e(t,n){let{children:r,tagName:o="div",value:i="",onChange:l,isSelected:a,multiline:s,inlineToolbar:c,wrapperClassName:u,autocompleters:d,onReplace:p,placeholder:m,allowedFormats:f,withoutInteractiveFormatting:h,onRemove:g,onMerge:b,onSplit:y,__unstableOnSplitAtEnd:_,__unstableOnSplitMiddle:k,identifier:x,preserveWhiteSpace:C,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:N,__unstableDisableFormats:B,disableLineBreaks:L,__unstableAllowPrefixTransformations:P,...A}=t;s&&(0,St.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const D=(0,dd.Z)(e);x=x||D,A=function(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:r,textAlign:o,selectionColor:i,tagsToEliminate:l,rootTagsToEliminate:a,disableEditingMenu:s,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:p,minWidth:m,maxWidth:f,setRef:h,disableSuggestions:g,disableAutocorrection:v,...b}=e;return b}(A);const R=(0,v.useRef)(),{clientId:M}=Su(),{selectionStart:O,selectionEnd:Z,isSelected:F}=(0,E.Z)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(ku),r=t(),o=n();let i;return void 0===a?i=r.clientId===M&&o.clientId===M&&r.attributeKey===x:a&&(i=r.clientId===M),{selectionStart:i?r.offset:void 0,selectionEnd:i?o.offset:void 0,isSelected:i}})),{getSelectionStart:j,getSelectionEnd:z,getBlockRootClientId:H}=(0,E.Z)(ku),{selectionChange:V}=(0,S.Z)(ku),W=GO(s),$=qO({allowedFormats:f,disableFormats:B}),U=!$||$.length>0;let G=i,q=l;Array.isArray(i)&&((0,St.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),G=yr.toHTML(i),q=e=>l(yr.fromDOM(wi(document,e).childNodes)));const K=(0,v.useCallback)(((e,t)=>{const n={},r=void 0===e&&void 0===t;if("number"==typeof e||r){if(void 0===t&&H(M)!==H(z().clientId))return;n.start={clientId:M,attributeKey:x,offset:e}}if("number"==typeof t||r){if(void 0===e&&H(M)!==H(j().clientId))return;n.end={clientId:M,attributeKey:x,offset:t}}V(n)}),[M,x]),{formatTypes:Y,prepareHandlers:X,valueHandlers:J,changeHandlers:Q,dependencies:ee}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:r,allowedFormats:o}=e;const i=(0,E.Z)(oZ,[]),l=(0,v.useMemo)((()=>i.filter((e=>{let{name:t,tagName:n}=e;return!(o&&!o.includes(t)||r&&iZ.has(n))}))),[i,o,iZ]),a=(0,E.Z)((e=>l.reduce(((r,o)=>o.__experimentalGetPropsForEditableTreePreparation?{...r,...lZ(o.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t}),o.name)}:r),{})),[l,t,n]),s=(0,S.Z)(),c=[],u=[],d=[],p=[];for(const e in a)p.push(a[e]);return l.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const r=e.__experimentalCreatePrepareEditableTree(aZ(a,e.name),{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?u.push(r):c.push(r)}if(e.__experimentalCreateOnChangeEditableValue){let r={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(r=e.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:n,blockClientId:t}));const o=aZ(a,e.name);d.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof o?o:{},...r},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:l,prepareHandlers:c,valueHandlers:u,changeHandlers:d,dependencies:p}}({clientId:M,identifier:x,withoutInteractiveFormatting:h,allowedFormats:$});function te(e){return Y.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=Wi(e,t.name,0,e.text.length))})),e.formats}const{value:ne,getValue:re,onChange:oe,ref:ie}=function(e){let{value:t="",selectionStart:n,selectionEnd:r,placeholder:o,preserveWhiteSpace:i,onSelectionChange:l,onChange:a,__unstableMultilineTag:s,__unstableDisableFormats:c,__unstableIsSelected:u,__unstableDependencies:d=[],__unstableAfterParse:p,__unstableBeforeSerialize:m,__unstableAddInvisibleFormats:f}=e;const h=(0,yl.Z)(),[,g]=(0,v.useReducer)((()=>({}))),b=(0,v.useRef)();function y(){const{ownerDocument:{defaultView:e}}=b.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return Ii({element:b.current,range:n,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:i})}function _(e){let{domOnly:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Nl({value:e,current:b.current,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,prepareEditableTree:f,__unstableDomOnly:t,placeholder:o})}const k=(0,v.useRef)(t),x=(0,v.useRef)();function w(){k.current=t,x.current=Ii({html:t,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,preserveWhiteSpace:i}),c&&(x.current.formats=Array(t.length),x.current.replacements=Array(t.length)),p&&(x.current.formats=p(x.current)),x.current.start=n,x.current.end=r}const C=(0,v.useRef)(!1);var E,S,I;x.current?n===x.current.start&&r===x.current.end||(C.current=u,x.current={...x.current,start:n,end:r}):(w(),"core/text-color"===(null===(E=x.current)||void 0===E||null===(S=E.formats[0])||void 0===S||null===(I=S[0])||void 0===I?void 0:I.type)&&function(e){x.current=e,k.current=rl({value:m?{...e,formats:m(e)}:e,multilineTag:s,preserveWhiteSpace:i});const{formats:t,text:n}=e;h.batch((()=>{a(k.current,{__unstableFormats:t,__unstableText:n})})),g()}(x.current));function T(e){x.current=e,_(e),k.current=c?e.text:rl({value:m?{...e,formats:m(e)}:e,multilineTag:s,preserveWhiteSpace:i});const{start:t,end:n,formats:r,text:o}=e;h.batch((()=>{l(t,n),a(k.current,{__unstableFormats:r,__unstableText:o})})),g()}function N(){w(),_(x.current)}const B=(0,v.useRef)(!1);(0,v.useLayoutEffect)((()=>{B.current&&t!==k.current&&(N(),g())}),[t]),(0,v.useLayoutEffect)((()=>{C.current&&(b.current.ownerDocument.activeElement!==b.current&&b.current.focus(),N(),C.current=!1)}),[C.current]);const L=(0,vl.Z)([b,(0,v.useCallback)((e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")}),[]),Ll({record:x}),Pl({record:x,multilineTag:s,preserveWhiteSpace:i}),(0,bl.Z)((e=>{function t(t){const{target:n}=t;if(n===e||n.textContent)return;const{ownerDocument:r}=n,{defaultView:o}=r,i=r.createRange(),l=o.getSelection();i.selectNode(n),l.removeAllRanges(),l.addRange(i)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]),Rl({record:x,applyRecord:_}),zl({createRecord:y,handleChange:T,multilineTag:s}),Fl({record:x,applyRecord:_,createRecord:y,handleChange:T,isSelected:u,onSelectionChange:l}),(0,bl.Z)((e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n.getSelection();let o;function i(){return r.rangeCount?r.getRangeAt(0):null}function l(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,l),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function l(){r(),o!==i()&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,l),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=i()}return e.addEventListener("pointerdown",l),e.addEventListener("keydown",l),()=>{e.removeEventListener("pointerdown",l),e.removeEventListener("keydown",l)}}),[]),(0,bl.Z)((()=>{N(),B.current=!0}),[o,...d])]);return{value:x.current,getValue:()=>x.current,onChange:T,ref:L}}({value:G,onChange(e,t){let{__unstableFormats:n,__unstableText:r}=t;q(e),Object.values(Q).forEach((e=>{e(n,r)}))},selectionStart:O,selectionEnd:Z,onSelectionChange:K,placeholder:m,__unstableIsSelected:F,__unstableMultilineTag:W,__unstableDisableFormats:B,preserveWhiteSpace:C,__unstableDependencies:[...ee,o],__unstableAfterParse:function(e){return J.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:te,__unstableAddInvisibleFormats:function(e){return X.reduce(((t,n)=>n(t,e.text)),e.formats)}}),le=function(e){return function(e){const t=(0,v.useRef)(),n=(0,v.useRef)(),{record:r}=e,o=function(e){const t=(0,v.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:l,activeId:a,onKeyDown:s}=AO({...e,contentRef:t});n.current=s;const c=(0,vl.Z)([t,(0,bl.Z)((e=>{function t(e){n.current(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==(null==o?void 0:o.text)?{ref:c,children:i,"aria-autocomplete":l?"list":void 0,"aria-owns":l,"aria-activedescendant":a}:{ref:c}}({...e,completers:FO(e)})}({onReplace:p,completers:d,record:ne,onChange:oe});!function(e){let{html:t,value:n}=e;const r=(0,v.useRef)(),o=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:i}=(0,S.Z)(ku);(0,v.useLayoutEffect)((()=>{if(r.current){if(r.current!==n.text){const e=window.setTimeout((()=>{i()}),1e3);return r.current=n.text,()=>{window.clearTimeout(e)}}i()}else r.current=n.text}),[t,o])}({html:G,value:ne});const ae=(0,v.useRef)(new Set),se=(0,v.useRef)(new Set);function ce(){var e;null===(e=R.current)||void 0===e||e.focus()}const ue=o;return(0,v.createElement)(v.Fragment,null,F&&(0,v.createElement)(mZ.Provider,{value:ae},(0,v.createElement)(fZ.Provider,{value:se},(0,v.createElement)(T.Z.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},r&&r({value:ne,onChange:oe,onFocus:ce}),(0,v.createElement)(pZ,{value:ne,onChange:oe,onFocus:ce,formatTypes:Y,forwardedRef:R})))),F&&U&&(0,v.createElement)(WO,{inline:c,editableContentElement:R.current,value:ne}),(0,v.createElement)(ue,(0,Po.Z)({role:"textbox","aria-multiline":!L,"aria-label":m},A,le,{ref:(0,vl.Z)([n,le.ref,A.ref,ie,QO({value:ne,onChange:oe}),tZ({getValue:re,onChange:oe,__unstableAllowPrefixTransformations:P,formatTypes:Y,onReplace:p,selectionChange:V}),uZ(),(0,bl.Z)((e=>{function t(e){(Al.isKeyboardEvent.primary(e,"z")||Al.isKeyboardEvent.primary(e,"y")||Al.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),sZ(ae),cZ(se),$O(),XO({isSelected:F,disableFormats:B,onChange:oe,value:ne,formatTypes:Y,tagName:o,onReplace:p,onSplit:y,onSplitMiddle:k,__unstableEmbedURLOnPaste:N,multilineTag:W,preserveWhiteSpace:C,pastePlainText:I}),nZ({value:ne,onMerge:b,onRemove:g}),rZ({removeEditorOnlyFormats:te,value:ne,onReplace:p,onSplit:y,onSplitMiddle:k,multilineTag:W,onChange:oe,disableLineBreaks:L,onSplitAtEnd:_}),dZ(),R]),contentEditable:!0,suppressContentEditableWarning:!0,className:w()("block-editor-rich-text__editable",A.className,"rich-text")})))}));hZ.Content=e=>{let{value:t,tagName:n,multiline:r,...o}=e;Array.isArray(t)&&((0,St.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=yr.toHTML(t));const i=GO(r);!t&&i&&(t=`<${i}>`);const l=(0,v.createElement)(pn.Z,null,t);if(n){const{format:e,...t}=o;return(0,v.createElement)(n,t,l)}return l},hZ.isEmpty=e=>!e||0===e.length;var gZ=hZ;function vZ(e){let{character:t,type:n,onUse:r}=e;const o=(0,v.useContext)(mZ),i=(0,v.useRef)();return i.current=r,(0,v.useEffect)((()=>{function e(e){Al.isKeyboardEvent[n](e,t)&&(i.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t,n]),null}function bZ(e){let t,{name:n,shortcutType:r,shortcutCharacter:o,...i}=e,l="RichText.ToolbarControls";return n&&(l+=`.${n}`),r&&o&&(t=Al.displayShortcut[r](o)),(0,v.createElement)(I.de,{name:l},(0,v.createElement)(Fo,(0,Po.Z)({},i,{shortcut:t})))}function yZ(e){let{inputType:t,onInput:n}=e;const r=(0,v.useContext)(fZ),o=(0,v.useRef)();return o.current=n,(0,v.useEffect)((()=>{function e(e){e.inputType===t&&(o.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t]),null}var _Z=n(45709);const kZ="none",xZ="custom",wZ="media",CZ="attachment",EZ=["noreferrer","noopener"],SZ=(0,v.createElement)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,v.createElement)(tp.y$,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,v.createElement)(tp.y$,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),IZ=e=>{let{linkDestination:t,onChangeUrl:n,url:r,mediaType:o="image",mediaUrl:i,mediaLink:l,linkTarget:a,linkClass:s,rel:c}=e;const[u,d]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),f=(0,v.useCallback)((()=>{d(!0)})),[h,g]=(0,v.useState)(!1),[b,y]=(0,v.useState)(null),_=(0,v.useRef)(null),k=(0,v.useCallback)((()=>{t!==wZ&&t!==CZ||y(""),g(!0)})),x=(0,v.useCallback)((()=>{g(!1)})),w=(0,v.useCallback)((()=>{y(null),x(),d(!1)})),C=(0,v.useCallback)((()=>e=>{const t=_.current;t&&t.contains(e.target)||(d(!1),y(null),x())})),E=(0,v.useCallback)((()=>e=>{if(b){var t;const e=(null===(t=I().find((e=>e.url===b)))||void 0===t?void 0:t.linkDestination)||xZ;n({href:b,linkDestination:e})}x(),y(null),e.preventDefault()})),S=(0,v.useCallback)((()=>{n({linkDestination:kZ,href:""})})),I=()=>{const e=[{linkDestination:wZ,title:(0,N.__)("Media File"),url:"image"===o?i:void 0,icon:SZ}];return"image"===o&&l&&e.push({linkDestination:CZ,title:(0,N.__)("Attachment Page"),url:"image"===o?l:void 0,icon:(0,v.createElement)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,v.createElement)(tp.y$,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,v.createElement)(sw.Z,{spacing:"3"},(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=c?c:"").split(" ");EZ.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=c?c:"").split(" ").filter((e=>!1===EZ.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Link rel"),value:null!=c?c:"",onChange:e=>{n({rel:e})}}),(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Link CSS Class"),value:s||"",onChange:e=>{n({linkClass:e})}})),B=null!==b?b:r,L=(I().find((e=>e.linkDestination===t))||{}).title;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Fo,{icon:rT.Z,className:"components-toolbar__control",label:r?(0,N.__)("Edit link"):(0,N.__)("Insert link"),"aria-expanded":u,onClick:f,ref:m}),u&&(0,v.createElement)(IO,{anchor:p,onFocusOutside:C(),onClose:w,renderSettings:()=>T,additionalControls:!B&&(0,v.createElement)(oE.Z,null,I().map((e=>(0,v.createElement)(Zu.Z,{key:e.linkDestination,icon:e.icon,onClick:()=>{y(null),(e=>{const t=I();let r;r=e?(t.find((t=>t.url===e))||{linkDestination:xZ}).linkDestination:kZ,n({linkDestination:r,href:e})})(e.url),x()}},e.title))))},(!r||h)&&(0,v.createElement)(IO.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:B,onChangeInputValue:y,onSubmit:E(),autocompleteRef:_}),r&&!h&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(IO.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:r,onEditLinkClick:k,urlLabel:L}),(0,v.createElement)(Mo.ZP,{icon:_Z.Z,label:(0,N.__)("Remove link"),onClick:S}))))};var TZ=(0,mh.Z)((e=>({selectedBlockClientId:e(ku).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=$y(t);return t?(0,v.createElement)(Mo.ZP,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,N.__)("Skip to the selected block")):null}));const NZ={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp://g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function BZ(e,t){return t.replace(e.HTMLRegExp,"\n")}function LZ(e,t){return t.replace(e.astralRegExp,"a")}function PZ(e,t){return t.replace(e.HTMLEntityRegExp,"")}function AZ(e,t){return t.replace(e.connectorRegExp," ")}function DZ(e,t){return t.replace(e.removeRegExp,"")}function RZ(e,t){return t.replace(e.HTMLcommentRegExp,"")}function MZ(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function OZ(e,t){return t.replace(e.spaceRegExp," ")}function ZZ(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function FZ(e,t,n){var r,o;return e=[BZ.bind(null,n),RZ.bind(null,n),MZ.bind(null,n),LZ.bind(null,n),OZ.bind(null,n),ZZ.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}var jZ=(0,mh.Z)((e=>{const{getMultiSelectedBlocks:t}=e(ku);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=function(e,t,n){const r=function(e,t){var n,r;const o=Object.assign({},NZ,t);return o.shortcodes=null!==(n=null===(r=o.l10n)||void 0===r?void 0:r.shortcodes)&&void 0!==n?n:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,"characters_excluding_spaces"!==o.type&&"characters_including_spaces"!==o.type&&(o.type="words"),o}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r,o;return e=[BZ.bind(null,n),RZ.bind(null,n),MZ.bind(null,n),OZ.bind(null,n),PZ.bind(null,n),AZ.bind(null,n),DZ.bind(null,n)].reduce(((e,t)=>t(e)),e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,FZ(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,FZ(e,o,r);default:return 0}}(Cn(t),"words");return(0,v.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,v.createElement)(k_,{icon:fE.Z,showColors:!0}),(0,v.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,v.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,N.sprintf)((0,N._n)("%d block","%d blocks",t.length),t.length)),(0,v.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,N.sprintf)((0,N._n)("%d word","%d words",n),n))))}));const zZ=()=>{};var HZ=function(e){let{choices:t=[],onHover:n=zZ,onSelect:r,value:o}=e;return(0,v.createElement)(v.Fragment,null,t.map((e=>{const t=o===e.value;return(0,v.createElement)(Zu.Z,{key:e.value,role:"menuitemradio",icon:t&&If.Z,info:e.info,isSelected:t,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{t||r(e.value)},onMouseEnter:()=>n(e.value),onMouseLeave:()=>n(null),"aria-label":e["aria-label"]},e.label)})))};function VZ(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;return(0,v.createElement)("fieldset",{className:t},(0,v.createElement)(n_.Z,{as:"legend"},(0,N.__)("Transform to variation")),o.map((e=>(0,v.createElement)(Mo.ZP,{key:e.name,icon:(0,v.createElement)(k_,{icon:e.icon,showColors:!0}),isPressed:r===e.name,label:r===e.name?e.title:(0,N.sprintf)((0,N.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function WZ(e){let{className:t,onSelectVariation:n,selectedValue:r,variations:o}=e;const i=o.map((e=>{let{name:t,title:n,description:r}=e;return{value:t,label:n,info:r}}));return(0,v.createElement)(zo.Z,{className:t,label:(0,N.__)("Transform to variation"),text:(0,N.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:VC.Z,toggleProps:{iconPosition:"right"}},(()=>(0,v.createElement)("div",{className:`${t}__container`},(0,v.createElement)(Ou.Z,null,(0,v.createElement)(HZ,{choices:i,value:r,onSelect:n})))))}var $Z=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,S.Z)(ku),{activeBlockVariation:r,variations:o}=(0,E.Z)((e=>{const{getActiveBlockVariation:n,getBlockVariations:r}=e(Xt),{getBlockName:o,getBlockAttributes:i}=e(ku),l=t&&o(t);return{activeBlockVariation:n(l,i(t)),variations:l&&r(l,"transform")}}),[t]),i=null==r?void 0:r.name,l=(0,v.useMemo)((()=>{const e=new Set;return!!o&&(o.forEach((t=>{var n;t.icon&&e.add((null===(n=t.icon)||void 0===n?void 0:n.src)||t.icon)})),e.size===o.length)}),[o]);if(null==o||!o.length)return null;const a=l?VZ:WZ;return(0,v.createElement)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...o.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:o})};function UZ(e){var t;let{genericPreviewBlock:n,style:r,className:o,activeStyle:i}=e;const l=null===(t=pe(n.name))||void 0===t?void 0:t.example,a=kE(o,i,r),s=(0,v.useMemo)((()=>({...n,title:r.label||r.name,description:r.description,initialAttributes:{...n.attributes,className:a+" block-editor-block-styles__block-preview-container"},example:l})),[n,a]);return(0,v.createElement)(zk,{item:s,isStylePreview:!0})}const GZ=()=>{};function qZ(e){let{clientId:t,onSwitch:n=GZ,onHoverClassName:r=GZ}=e;const{onSelect:o,stylesToRender:i,activeStyle:l,genericPreviewBlock:a,className:s}=wE({clientId:t,onSwitch:n}),[c,u]=(0,v.useState)(null),d=(0,ch.Z)("medium","<");if(!i||0===i.length)return null;const p=(0,dh.D)(u,250),m=e=>{var t;c!==e?(p(e),r(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):p.cancel()};return(0,v.createElement)("div",{className:"block-editor-block-styles"},(0,v.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.isDefault?(0,N.__)("Default"):e.label||e.name;return(0,v.createElement)(Mo.ZP,{className:w()("block-editor-block-styles__item",{"is-active":l.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>m(e),onFocus:()=>m(e),onMouseLeave:()=>m(null),onBlur:()=>m(null),onClick:()=>(e=>{o(e),r(null),u(null),p.cancel()})(e),"aria-current":l.name===e.name},(0,v.createElement)(Uk,{numberOfLines:1,className:"block-editor-block-styles__item-text"},t))}))),c&&!d&&(0,v.createElement)(T.Z,{placement:"left-start",offset:20,focusOnMount:!1},(0,v.createElement)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>m(null)},(0,v.createElement)(UZ,{activeStyle:l,className:s,genericPreviewBlock:a,style:c}))))}var KZ=qZ;function YZ(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:r,styles:o}=(0,E.Z)((e=>{var n,r;const o=e(ku).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==o||null===(n=o.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(r=null==o?void 0:o.onChange)&&void 0!==r?r:null,styles:e(Xt).getBlockStyles(t)}}),[t]),i=(0,v.useMemo)((()=>[{label:(0,N.__)("Not set"),value:""},...o.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[o]),l=(0,v.useMemo)((()=>{var e;return null===(e=xE(o))||void 0===e?void 0:e.name}),[o]),a=(0,v.useCallback)((e=>{r(t,e)}),[t,r]);return n&&n!==l?r&&(0,v.createElement)("div",{className:"default-style-picker__default-switcher"},(0,v.createElement)(BT.Z,{__nextHasNoMarginBottom:!0,options:i,value:n||"",label:(0,N.__)("Default Style"),onChange:a})):null}qZ.Slot=()=>((0,St.default)("BlockStyles.Slot",{version:"6.4",since:"6.2"}),null);var XZ=n(45029),JZ=n(44451),QZ=n(71295);const eF={name:"settings",title:"Settings",value:"settings",icon:XZ.Z,className:"block-editor-block-inspector__tab-item"},tF={name:"styles",title:"Styles",value:"styles",icon:JZ.Z,className:"block-editor-block-inspector__tab-item"},nF={name:"list",title:"List View",value:"list-view",icon:QZ.Z,className:"block-editor-block-inspector__tab-item"};var rF=()=>{const e=Lu(th.slotName);return Boolean(e&&e.length)?(0,v.createElement)(pf.Z,{className:"block-editor-block-inspector__advanced",title:(0,N.__)("Advanced"),initialOpen:!1},(0,v.createElement)(nh.Slot,{group:"advanced"})):null},oF=()=>{const e=Lu(wf.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,v.createElement)(pf.Z,{className:"block-editor-block-inspector__position",title:(0,N.__)("Position"),initialOpen:!1},(0,v.createElement)(nh.Slot,{group:"position"})):null},iF=n(6107);const lF="isInspectorControlsTabsHintVisible";function aF(){const e=(0,E.Z)((e=>{var t;return null===(t=e(iF.h).get("core",lF))||void 0===t||t}),[]),t=(0,v.useRef)(),{set:n}=(0,S.Z)(iF.h);return e?(0,v.createElement)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint"},(0,v.createElement)("div",{className:"block-editor-inspector-controls-tabs__hint-content"},(0,N.__)("Looking for other block settings? They've moved to the styles tab.")),(0,v.createElement)(Mo.ZP,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:_Z.Z,iconSize:"16",label:(0,N.__)("Dismiss hint"),onClick:()=>{const e=wy.focus.tabbable.findPrevious(t.current);null==e||e.focus(),n("core",lF,!1)},showTooltip:!1})):null}var sF=e=>{let{showAdvancedControls:t=!1}=e;return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(nh.Slot,null),(0,v.createElement)(oF,null),t&&(0,v.createElement)("div",null,(0,v.createElement)(rF,null)),(0,v.createElement)(aF,null))},cF=e=>{let{blockName:t,clientId:n,hasBlockStyles:r}=e;return(0,v.createElement)(v.Fragment,null,r&&(0,v.createElement)("div",null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Styles")},(0,v.createElement)(KZ,{clientId:n}),he(t,"defaultStylePicker",!0)&&(0,v.createElement)(YZ,{blockName:t}))),(0,v.createElement)(nh.Slot,{group:"color",label:(0,N.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,v.createElement)(nh.Slot,{group:"typography",label:(0,N.__)("Typography")}),(0,v.createElement)(nh.Slot,{group:"dimensions",label:(0,N.__)("Dimensions")}),(0,v.createElement)(nh.Slot,{group:"border",label:(0,N.__)("Border")}),(0,v.createElement)(nh.Slot,{group:"styles"}))};const uF=["core/navigation"];var dF=e=>!uF.includes(e);function pF(e){let{blockName:t,clientId:n,hasBlockStyles:r,tabs:o}=e;const i=dF(t)?void 0:nF.name;return(0,v.createElement)(cC.Z,{className:"block-editor-block-inspector__tabs",tabs:o,initialTabName:i,key:n},(e=>e.name===eF.name?(0,v.createElement)(sF,{showAdvancedControls:!!t}):e.name===tF.name?(0,v.createElement)(cF,{blockName:t,clientId:n,hasBlockStyles:r}):e.name===nF.name?(0,v.createElement)(nh.Slot,{group:"list"}):void 0))}const mF=[];function fF(e){const t=[],{border:n,color:r,default:o,dimensions:i,list:l,position:a,styles:s,typography:c}=wf,u=dF(e),d=Lu(l.Slot.__unstableName),p=!u&&!!d&&d.length,m=[...Lu(n.Slot.__unstableName)||[],...Lu(r.Slot.__unstableName)||[],...Lu(i.Slot.__unstableName)||[],...Lu(s.Slot.__unstableName)||[],...Lu(c.Slot.__unstableName)||[]].length,f=Lu(th.slotName)||[],h=[...Lu(o.Slot.__unstableName)||[],...Lu(a.Slot.__unstableName)||[],...p&&m>1?f:[]];p&&t.push(nF),h.length&&t.push(eF),m&&t.push(tF);const g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,E.Z)((e=>e(ku).getSettings().blockInspectorTabs),[]));return g?t:mF}function hF(e,t){const n=(0,v.useMemo)((()=>e.reduce(((e,t)=>("core/list-item"!==t.name&&Object.entries(t.attributes).some((e=>{let[,{__experimentalRole:t}]=e;return"content"===t}))&&(e[t.name]=!0),e)),{})),[e]),r=(0,v.useCallback)((e=>!!n[e]),[n]);return(0,v.useMemo)((()=>gF([t],r)),[t,r])}function gF(e,t){const n=[];for(const r of e)t(r.name)&&n.push(r),n.push(...gF(r.innerBlocks,t));return n}function vF(e){let{blockTypes:t,block:n,selectedBlock:r}=e;const{selectBlock:o}=(0,S.Z)(ku),i=t.find((e=>{let{name:t}=e;return t===n.name})),l=r&&r.clientId===n.clientId;return(0,v.createElement)(Mo.ZP,{isPressed:l,onClick:()=>o(n.clientId)},(0,v.createElement)(Bf.Z,{justify:"flex-start"},(0,v.createElement)(k_,{icon:i.icon}),(0,v.createElement)(Gu.Z,null,i.title)))}function bF(e){let{topLevelLockedBlock:t}=e;const{blockTypes:n,block:r,selectedBlock:o}=(0,E.Z)((e=>({blockTypes:e(Xt).getBlockTypes(),block:e(ku).getBlock(t),selectedBlock:e(ku).getSelectedBlock()})),[t]),i=ZC(t),l=hF(n,r);return(0,v.createElement)("div",{className:"block-editor-block-inspector"},(0,v.createElement)(x_,(0,Po.Z)({},i,{className:i.isSynced&&"is-synced"})),(0,v.createElement)($Z,{blockClientId:t}),(0,v.createElement)(sw.Z,{spacing:1,padding:4,className:"block-editor-block-inspector__block-buttons-container"},(0,v.createElement)("h2",{className:"block-editor-block-card__title"},(0,N.__)("Content")),l.map((e=>(0,v.createElement)(vF,{selectedBlock:o,key:e.clientId,block:e,blockTypes:n})))))}const yF=e=>{let{animate:t,wrapper:n,children:r}=e;return t?n(r):r},_F=e=>{let{blockInspectorAnimationSettings:t,selectedBlockClientId:n,children:r}=e;const o=t&&"leftToRight"===t.enterDirection?-50:50;return(0,v.createElement)(Cw.E.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:o,opacity:0},key:n},r)},kF=e=>{let{clientId:t,blockName:n}=e;const r=fF(n),o=(null==r?void 0:r.length)>1,i=(0,E.Z)((e=>{const{getBlockStyles:t}=e(Xt),r=t(n);return r&&r.length>0}),[n]),l=ZC(t);return(0,v.createElement)("div",{className:"block-editor-block-inspector"},(0,v.createElement)(x_,(0,Po.Z)({},l,{className:l.isSynced&&"is-synced"})),(0,v.createElement)($Z,{blockClientId:t}),o&&(0,v.createElement)(pF,{hasBlockStyles:i,clientId:t,blockName:n,tabs:r}),!o&&(0,v.createElement)(v.Fragment,null,i&&(0,v.createElement)("div",null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Styles")},(0,v.createElement)(KZ,{clientId:t}),he(n,"defaultStylePicker",!0)&&(0,v.createElement)(YZ,{blockName:n}))),(0,v.createElement)(nh.Slot,null),(0,v.createElement)(nh.Slot,{group:"color",label:(0,N.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,v.createElement)(nh.Slot,{group:"typography",label:(0,N.__)("Typography")}),(0,v.createElement)(nh.Slot,{group:"dimensions",label:(0,N.__)("Dimensions")}),(0,v.createElement)(nh.Slot,{group:"border",label:(0,N.__)("Border")}),(0,v.createElement)(nh.Slot,{group:"styles"}),(0,v.createElement)(oF,null),(0,v.createElement)("div",null,(0,v.createElement)(rF,null))),(0,v.createElement)(TZ,{key:"back"}))};var xF=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,selectedBlockName:r,selectedBlockClientId:o,blockType:i,topLevelLockedBlock:l}=(0,E.Z)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r,__unstableGetContentLockingParent:o,getTemplateLock:i}=e(ku),l=t(),a=l&&r(l),s=a&&pe(a);return{count:n(),selectedBlockClientId:l,selectedBlockName:a,blockType:s,topLevelLockedBlock:o(l)||("contentOnly"===i(l)?l:void 0)}}),[]),a=fF(null==i?void 0:i.name),s=(null==a?void 0:a.length)>1,c=function(e,t){return(0,E.Z)((t=>{if(e){const n=t(ku).getSettings().blockInspectorAnimation,r=null==n?void 0:n.animationParent,{getSelectedBlockClientId:o,getBlockParentsByBlockName:i}=t(ku);return i(o(),r,!0)[0]||e.name===r?null==n?void 0:n[e.name]:null}return null}),[t,e])}(i,o);if(n>1)return(0,v.createElement)("div",{className:"block-editor-block-inspector"},(0,v.createElement)(jZ,null),s?(0,v.createElement)(pF,{tabs:a}):(0,v.createElement)(v.Fragment,null,(0,v.createElement)(nh.Slot,null),(0,v.createElement)(nh.Slot,{group:"color",label:(0,N.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,v.createElement)(nh.Slot,{group:"typography",label:(0,N.__)("Typography")}),(0,v.createElement)(nh.Slot,{group:"dimensions",label:(0,N.__)("Dimensions")}),(0,v.createElement)(nh.Slot,{group:"border",label:(0,N.__)("Border")}),(0,v.createElement)(nh.Slot,{group:"styles"})));const u=r===ue();return i&&o&&!u?l?(0,v.createElement)(bF,{topLevelLockedBlock:l}):(0,v.createElement)(yF,{animate:c,wrapper:e=>(0,v.createElement)(_F,{blockInspectorAnimationSettings:c,selectedBlockClientId:o},e)},(0,v.createElement)(kF,{clientId:o,blockName:i.name})):t?(0,v.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,N.__)("No block selected.")):null},wF=function(e){let{__unstableContentRef:t}=e;const[n,r]=(0,v.useState)(!1),o=(0,E.Z)((e=>e(ku).getBlockOrder()),[]);return(0,v.useEffect)((()=>{const e=setTimeout((()=>{r(!0)}),500);return()=>{clearTimeout(e)}}),[]),n?o.map(((e,n)=>n===o.length-1?null:(0,v.createElement)(IC,{key:e,previousClientId:e,nextClientId:o[n+1],__unstableContentRef:t},(0,v.createElement)("div",{className:"block-editor-block-list__insertion-point-inserter is-with-inserter"},(0,v.createElement)(yC,{position:"bottom center",clientId:o[n+1],__experimentalIsQuick:!0}))))):null};function CF(e){const{__unstableGetEditorMode:t,getSettings:n,isTyping:r}=e(ku);return{isZoomOutMode:"zoom-out"===t(),hasFixedToolbar:n().hasFixedToolbar,isTyping:r()}}function EF(e){let{children:t,__unstableContentRef:n,...r}=e;const o=(0,ch.Z)("medium"),{hasFixedToolbar:i,isZoomOutMode:l,isTyping:a}=(0,E.Z)(CF,[]),s=(0,K_.sx)(),{getSelectedBlockClientIds:c,getBlockRootClientId:u}=(0,E.Z)(ku),{duplicateBlocks:d,removeBlocks:p,insertAfterBlock:m,insertBeforeBlock:f,clearSelectedBlock:h,moveBlocksUp:g,moveBlocksDown:b}=(0,S.Z)(ku),y=EC(n),_=EC(n);return(0,v.createElement)("div",(0,Po.Z)({},r,{onKeyDown:function(e){if(!e.defaultPrevented)if(s("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);g(t,n)}}else if(s("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);b(t,n)}}else if(s("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),d(t))}else if(s("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),p(t))}else if(s("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),m(t[t.length-1]))}else if(s("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),f(t[0]))}else s("core/block-editor/unselect",e)&&c().length&&(e.preventDefault(),h(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges(),null==n||n.current.focus())}}),(0,v.createElement)(PC.Provider,{value:(0,v.useRef)(!1)},!a&&(0,v.createElement)(DC,{__unstableContentRef:n}),!l&&(i||!o)&&(0,v.createElement)(PS,{isFixed:!0}),(0,v.createElement)(fI,{__unstableContentRef:n}),(0,v.createElement)(T.Z.Slot,{name:"block-toolbar",ref:y}),t,(0,v.createElement)(T.Z.Slot,{name:"__unstable-block-tools-after",ref:_}),l&&(0,v.createElement)(wF,{__unstableContentRef:n})))}const SF=()=>{};var IF=(0,v.forwardRef)((function(e,t){let{rootClientId:n,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:s,onSelect:c=SF,shouldFocusBlock:u=!1}=e;const{destinationRootClientId:d,prioritizePatterns:p}=(0,E.Z)((e=>{const{getBlockRootClientId:t,getSettings:o}=e(ku);return{destinationRootClientId:n||t(r)||void 0,prioritizePatterns:o().__experimentalPreferPatternsOnRoot}}),[r,n]);return(0,v.createElement)(hC,{onSelect:c,rootClientId:d,clientId:r,isAppender:o,showInserterHelpPanel:i,showMostUsedBlocks:l,__experimentalInsertionIndex:a,__experimentalFilterValue:s,shouldFocusBlock:u,prioritizePatterns:p,ref:t})}));function TF(){return null}TF.Register=function(){const{registerShortcut:e}=(0,S.Z)(K_.h);return(0,v.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,N.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,N.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,N.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,N.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,N.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,N.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,N.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,N.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,N.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,N.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var NF=TF;const BF=new Set([Al.UP,Al.RIGHT,Al.DOWN,Al.LEFT,Al.ENTER,Al.BACKSPACE]);function LF(){const{isTyping:e,hasInlineToolbar:t}=(0,E.Z)((e=>{const{isTyping:t,getSettings:n}=e(ku);return{isTyping:t(),hasInlineToolbar:n().hasInlineToolbar}}),[]),{startTyping:n,stopTyping:r}=(0,S.Z)(ku),o=function(){const e=(0,E.Z)((e=>e(ku).isTyping()),[]),{stopTyping:t}=(0,S.Z)(ku);return(0,bl.Z)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function l(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",l),()=>{r.removeEventListener("mousemove",l)}}),[e,t])}(),i=(0,bl.Z)((o=>{const{ownerDocument:i}=o,{defaultView:l}=i,a=l.getSelection();if(e){let c;function u(e){const{target:t}=e;c=l.setTimeout((()=>{(0,Cy.Z)(t)||r()}))}function d(e){const{keyCode:t}=e;t!==Al.ESCAPE&&t!==Al.TAB||r()}function p(){a.isCollapsed||r()}return o.addEventListener("focus",u),o.addEventListener("keydown",d),t||i.addEventListener("selectionchange",p),()=>{l.clearTimeout(c),o.removeEventListener("focus",u),o.removeEventListener("keydown",d),i.removeEventListener("selectionchange",p)}}function s(e){const{type:t,target:r}=e;(0,Cy.Z)(r)&&o.contains(r)&&("keydown"!==t||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&BF.has(t)}(e))&&n()}return o.addEventListener("keypress",s),o.addEventListener("keydown",s),()=>{o.removeEventListener("keypress",s),o.removeEventListener("keydown",s)}}),[e,t,n,r]);return(0,vl.Z)([o,i])}var PF=function(e){let{children:t}=e;return(0,v.createElement)("div",{ref:LF()},t)};const AF={button:"wp-element-button",caption:"wp-element-caption"},DF=e=>AF[e]?AF[e]:"";var RF=n(51931),MF=n(59272),OF=n(87929);const ZF=async function(e){let{perPage:t=20}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await(0,y.default)({path:(0,Ow.f)("/wp/v2/search",{search:e,per_page:t,type:"post"})});return Array.isArray(n)?n.map((e=>({id:e.id,url:e.url,title:(0,Dn.decodeEntities)(e.title)||`(${OF.x.I18n.t("noName")})`,type:e.subtype||e.type}))):[]};var FF=n(39519),jF=n.n(FF),zF=n(35250);function HF(e){let{isActive:t,label:n,info:r,onToggle:o}=e;return(0,zF.jsx)(Zu.Z,{icon:t&&If.Z,isSelected:t,onClick:o,role:"menuitemcheckbox",info:r,children:n})}var VF=n(17734);const WF="mailpoet-form-editor",$F=Uo.fontSizes.map((e=>({...e,size:`${e.size}${Number.isNaN(Number(`${e.size}`||NaN))?"":"px"}`}))),UF=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,U.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,U.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,U.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,U.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,U.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,U.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,U.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,U.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,U.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},GF=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.color:n},qF=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.gradient:n},KF=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=e.find((e=>e.slug===t));return r?r.size:n},YF=(e,t,n,r)=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=i=>{if(!Array.isArray(i))throw new Error("Mapper expects blocks to be an array.");return i.map((i=>{var l,a,s,c,u,d,p,m,f,h,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,L,P,A,D,R,M,O;const Z={type:"text",params:{label:i.attributes.label,class_name:i.attributes.className||null}};switch(i.attributes.mandatory&&(Z.params.required="1"),i.attributes.labelWithinInput&&(Z.params.label_within="1"),i.name){case"core/heading":return{type:"heading",id:"heading",params:{content:i.attributes.content,level:i.attributes.level,align:i.attributes.textAlign||"left",font_size:KF(e,i.attributes.fontSize,(null===(l=i.attributes.style)||void 0===l||null===(a=l.typography)||void 0===a?void 0:a.fontSize)||null),text_color:GF(t,i.attributes.textColor,(null===(s=i.attributes.style)||void 0===s||null===(c=s.color)||void 0===c?void 0:c.text)||null),line_height:null===(u=i.attributes.style)||void 0===u||null===(d=u.typography)||void 0===d?void 0:d.lineHeight,background_color:GF(t,i.attributes.backgroundColor,(null===(p=i.attributes.style)||void 0===p||null===(m=p.color)||void 0===m?void 0:m.background)||null),anchor:i.attributes.anchor||null,class_name:i.attributes.className||null}};case"core/paragraph":return{type:"paragraph",id:"paragraph",params:{content:i.attributes.content,drop_cap:i.attributes.dropCap?"1":"0",align:i.attributes.align||"left",font_size:KF(e,i.attributes.fontSize,(null===(f=i.attributes.style)||void 0===f||null===(h=f.typography)||void 0===h?void 0:h.fontSize)||null),line_height:null===(g=i.attributes.style)||void 0===g||null===(v=g.typography)||void 0===v?void 0:v.lineHeight,text_color:GF(t,i.attributes.textColor,(null===(b=i.attributes.style)||void 0===b||null===(y=b.color)||void 0===y?void 0:y.text)||null),background_color:GF(t,i.attributes.backgroundColor,(null===(_=i.attributes.style)||void 0===_||null===(k=_.color)||void 0===k?void 0:k.background)||null),class_name:i.attributes.className||null}};case"core/image":return{type:"image",id:"image",params:{class_name:i.attributes.className||null,align:i.attributes.align||null,url:i.attributes.url||null,alt:i.attributes.alt||null,title:i.attributes.title||null,caption:i.attributes.caption||null,link_destination:i.attributes.linkDestination||null,link:i.attributes.link||null,href:i.attributes.href||null,link_class:i.attributes.linkClass||null,rel:i.attributes.rel||null,link_target:i.attributes.linkTarget||null,id:i.attributes.id||null,size_slug:i.attributes.sizeSlug||null,width:i.attributes.width||null,height:i.attributes.height||null}};case"core/column":return{type:"column",body:o(i.innerBlocks),params:{class_name:i.attributes.className||null,vertical_alignment:i.attributes.verticalAlignment||null,width:i.attributes.width||null,padding:(null===(x=i.attributes.style)||void 0===x||null===(w=x.spacing)||void 0===w?void 0:w.padding)||null,text_color:GF(t,i.attributes.textColor,(null===(C=i.attributes.style)||void 0===C||null===(E=C.color)||void 0===E?void 0:E.text)||null),background_color:GF(t,i.attributes.backgroundColor,(null===(S=i.attributes.style)||void 0===S||null===(I=S.color)||void 0===I?void 0:I.background)||null),gradient:qF(n,i.attributes.gradient,(null===(T=i.attributes.style)||void 0===T||null===(N=T.color)||void 0===N?void 0:N.gradient)||null)}};case"core/columns":return{type:"columns",body:o(i.innerBlocks),params:{vertical_alignment:i.attributes.verticalAlignment||null,is_stacked_on_mobile:i.attributes.isStackedOnMobile||void 0===i.attributes.isStackedOnMobile?"1":"0",class_name:i.attributes.className||null,padding:(null===(B=i.attributes.style)||void 0===B||null===(L=B.spacing)||void 0===L?void 0:L.padding)||null,text_color:GF(t,i.attributes.textColor,(null===(P=i.attributes.style)||void 0===P||null===(A=P.color)||void 0===A?void 0:A.text)||null),background_color:GF(t,i.attributes.backgroundColor,(null===(D=i.attributes.style)||void 0===D||null===(R=D.color)||void 0===R?void 0:R.background)||null),gradient:qF(n,i.attributes.gradient,(null===(M=i.attributes.style)||void 0===M||null===(O=M.color)||void 0===O?void 0:O.gradient)||null)}};case"mailpoet-form/email-input":return{...Z,id:"email",name:"Email",params:{...Z.params,required:"1"},styles:UF(i.attributes.styles)};case"mailpoet-form/first-name-input":return{...Z,id:"first_name",name:"First name",styles:UF(i.attributes.styles)};case"mailpoet-form/last-name-input":return{...Z,id:"last_name",name:"Last name",styles:UF(i.attributes.styles)};case"mailpoet-form/segment-select":return{...Z,id:"segments",type:"segment",name:"List selection",params:{...Z.params,values:i.attributes.values.map((e=>({id:e.id,is_checked:e.isChecked?"1":void 0})))}};case"mailpoet-form/submit-button":return{...Z,id:"submit",type:"submit",name:"Submit",styles:UF(i.attributes.styles)};case"mailpoet-form/divider":return{...Z,id:"divider",type:"divider",name:"Divider",params:{class_name:i.attributes.className||null,height:i.attributes.height,type:i.attributes.type,style:i.attributes.style,divider_height:i.attributes.dividerHeight,divider_width:i.attributes.dividerWidth,color:i.attributes.color}};case"mailpoet-form/html":return{...Z,id:"html",type:"html",name:"Custom text or HTML",params:{text:i.attributes&&i.attributes.content?i.attributes.content:"",nl2br:i.attributes&&i.attributes.nl2br?"1":"0",class_name:i.attributes.className||null}};default:return i.name.startsWith("mailpoet-form/custom-")?((e,t,n)=>{const r=t.find((t=>t.id===e.attributes.customFieldId));if(!r)return null;const o={...n,id:e.attributes.customFieldId.toString(),name:r.name};return e.name.startsWith("mailpoet-form/custom-date")&&(o.type="date"),e.name.startsWith("mailpoet-form/custom-text")&&(o.type="text",o.styles=UF(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(o.type="textarea",o.styles=UF(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-radio")&&(o.type="radio"),e.name.startsWith("mailpoet-form/custom-checkbox")&&(o.type="checkbox"),e.name.startsWith("mailpoet-form/custom-select")&&(o.type="select"),(0,U.has)(e.attributes,"validate")&&(o.params.validate=e.attributes.validate),(0,U.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(o.params.hide_label="1"),(0,U.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(o.params.is_default_today="1"),(0,U.has)(e.attributes,"dateType")&&(o.params.date_type=e.attributes.dateType),(0,U.has)(e.attributes,"lines")&&(o.params.lines=e.attributes.lines),(0,U.has)(e.attributes,"dateFormat")&&(o.params.date_format=e.attributes.dateFormat),(0,U.has)(e.attributes,"values")&&(o.params.values=e.attributes.values.map((e=>{const t={value:e.name};return(0,U.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t}))),o})(i,r,Z):null}})).filter(Boolean)};return o};function XF(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,f,h,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,L,P,A,D,R,M,O,Z,F,j,z,H,V,W,$,U,G,q,K,Y,X,J,Q,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,fe,he,ge,ve,be,ye,_e,ke,xe,we,Ce,Ee,Se,Ie,Te,Ne,Be,Le,Pe,Ae,De,Re,Me,Oe,Ze,Fe,je,ze,He,Ve,We,$e,Ue,Ge,qe,Ke,Ye,Xe,Je;const Qe={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===(null===(t=e.settings.formPlacement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled)?"1":"",exit_intent_enabled:null!==(r=e.settings.formPlacement)&&void 0!==r&&null!==(o=r.popup)&&void 0!==o&&o.exitIntentEnabled?"1":"",delay:null===(i=e.settings.formPlacement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay,cookieExpiration:null===(a=e.settings.formPlacement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.cookieExpiration,styles:null===(c=e.settings.formPlacement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.styles,animation:null===(d=e.settings.formPlacement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.animation,categories:(null===(m=e.settings.formPlacement)||void 0===m||null===(f=m.popup)||void 0===f?void 0:f.categories)??[],tags:(null===(h=e.settings.formPlacement)||void 0===h||null===(g=h.popup)||void 0===g?void 0:g.tags)??[],posts:{all:!0===(null===(v=e.settings.formPlacement)||void 0===v||null===(b=v.popup)||void 0===b||null===(y=b.posts)||void 0===y?void 0:y.all)?"1":"",selected:null===(_=e.settings.formPlacement)||void 0===_||null===(k=_.popup)||void 0===k||null===(x=k.posts)||void 0===x?void 0:x.selected},pages:{all:!0===(null===(w=e.settings.formPlacement)||void 0===w||null===(C=w.popup)||void 0===C||null===(E=C.pages)||void 0===E?void 0:E.all)?"1":"",selected:null===(S=e.settings.formPlacement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.pages)||void 0===T?void 0:T.selected}},fixed_bar:{enabled:!0===(null===(N=e.settings.formPlacement)||void 0===N||null===(B=N.fixedBar)||void 0===B?void 0:B.enabled)?"1":"",delay:null===(L=e.settings.formPlacement)||void 0===L||null===(P=L.fixedBar)||void 0===P?void 0:P.delay,cookieExpiration:null===(A=e.settings.formPlacement)||void 0===A||null===(D=A.fixedBar)||void 0===D?void 0:D.cookieExpiration,styles:null===(R=e.settings.formPlacement)||void 0===R||null===(M=R.fixedBar)||void 0===M?void 0:M.styles,position:null===(O=e.settings.formPlacement)||void 0===O||null===(Z=O.fixedBar)||void 0===Z?void 0:Z.position,animation:null===(F=e.settings.formPlacement)||void 0===F||null===(j=F.fixedBar)||void 0===j?void 0:j.animation,categories:(null===(z=e.settings.formPlacement)||void 0===z||null===(H=z.fixedBar)||void 0===H?void 0:H.categories)??[],tags:(null===(V=e.settings.formPlacement)||void 0===V||null===(W=V.fixedBar)||void 0===W?void 0:W.tags)??[],posts:{all:!0===(null===($=e.settings.formPlacement)||void 0===$||null===(U=$.fixedBar)||void 0===U||null===(G=U.posts)||void 0===G?void 0:G.all)?"1":"",selected:null===(q=e.settings.formPlacement)||void 0===q||null===(K=q.fixedBar)||void 0===K||null===(Y=K.posts)||void 0===Y?void 0:Y.selected},pages:{all:!0===(null===(X=e.settings.formPlacement)||void 0===X||null===(J=X.fixedBar)||void 0===J||null===(Q=J.pages)||void 0===Q?void 0:Q.all)?"1":"",selected:null===(ee=e.settings.formPlacement)||void 0===ee||null===(te=ee.fixedBar)||void 0===te||null===(ne=te.pages)||void 0===ne?void 0:ne.selected}},below_posts:{enabled:!0===(null===(re=e.settings.formPlacement)||void 0===re||null===(oe=re.belowPosts)||void 0===oe?void 0:oe.enabled)?"1":"",styles:null===(ie=e.settings.formPlacement)||void 0===ie||null===(le=ie.belowPosts)||void 0===le?void 0:le.styles,categories:(null===(ae=e.settings.formPlacement)||void 0===ae||null===(se=ae.belowPosts)||void 0===se?void 0:se.categories)??[],tags:(null===(ce=e.settings.formPlacement)||void 0===ce||null===(ue=ce.belowPosts)||void 0===ue?void 0:ue.tags)??[],posts:{all:!0===(null===(de=e.settings.formPlacement)||void 0===de||null===(pe=de.belowPosts)||void 0===pe||null===(me=pe.posts)||void 0===me?void 0:me.all)?"1":"",selected:null===(fe=e.settings.formPlacement)||void 0===fe||null===(he=fe.belowPosts)||void 0===he||null===(ge=he.posts)||void 0===ge?void 0:ge.selected},pages:{all:!0===(null===(ve=e.settings.formPlacement)||void 0===ve||null===(be=ve.belowPosts)||void 0===be||null===(ye=be.pages)||void 0===ye?void 0:ye.all)?"1":"",selected:null===(_e=e.settings.formPlacement)||void 0===_e||null===(ke=_e.belowPosts)||void 0===ke||null===(xe=ke.pages)||void 0===xe?void 0:xe.selected}},slide_in:{enabled:!0===(null===(we=e.settings.formPlacement)||void 0===we||null===(Ce=we.slideIn)||void 0===Ce?void 0:Ce.enabled)?"1":"",delay:null===(Ee=e.settings.formPlacement)||void 0===Ee||null===(Se=Ee.slideIn)||void 0===Se?void 0:Se.delay,cookieExpiration:null===(Ie=e.settings.formPlacement)||void 0===Ie||null===(Te=Ie.slideIn)||void 0===Te?void 0:Te.cookieExpiration,position:null===(Ne=e.settings.formPlacement)||void 0===Ne||null===(Be=Ne.slideIn)||void 0===Be?void 0:Be.position,animation:null===(Le=e.settings.formPlacement)||void 0===Le||null===(Pe=Le.slideIn)||void 0===Pe?void 0:Pe.animation,styles:null===(Ae=e.settings.formPlacement)||void 0===Ae||null===(De=Ae.slideIn)||void 0===De?void 0:De.styles,categories:(null===(Re=e.settings.formPlacement)||void 0===Re||null===(Me=Re.slideIn)||void 0===Me?void 0:Me.categories)??[],tags:(null===(Oe=e.settings.formPlacement)||void 0===Oe||null===(Ze=Oe.slideIn)||void 0===Ze?void 0:Ze.tags)??[],posts:{all:!0===(null===(Fe=e.settings.formPlacement)||void 0===Fe||null===(je=Fe.slideIn)||void 0===je||null===(ze=je.posts)||void 0===ze?void 0:ze.all)?"1":"",selected:null===(He=e.settings.formPlacement)||void 0===He||null===(Ve=He.slideIn)||void 0===Ve||null===(We=Ve.posts)||void 0===We?void 0:We.selected},pages:{all:!0===(null===($e=e.settings.formPlacement)||void 0===$e||null===(Ue=$e.slideIn)||void 0===Ue||null===(Ge=Ue.pages)||void 0===Ge?void 0:Ge.all)?"1":"",selected:null===(qe=e.settings.formPlacement)||void 0===qe||null===(Ke=qe.slideIn)||void 0===Ke||null===(Ye=Ke.pages)||void 0===Ye?void 0:Ye.selected}},others:{styles:null===(Xe=e.settings.formPlacement)||void 0===Xe||null===(Je=Xe.others)||void 0===Je?void 0:Je.styles}},border_radius:e.settings.borderRadius,border_size:e.settings.borderSize,form_padding:e.settings.formPadding,input_padding:e.settings.inputPadding,border_color:e.settings.borderColor,font_family:e.settings.fontFamily,success_validation_color:e.settings.successValidationColor,error_validation_color:e.settings.errorValidationColor,background_image_url:e.settings.backgroundImageUrl,background_image_display:e.settings.backgroundImageDisplay,close_button:e.settings.closeButton}};return""===Qe.settings.font_family&&delete Qe.settings.font_family,delete Qe.settings.formPlacement,delete Qe.settings.successValidationColor,delete Qe.settings.errorValidationColor,delete Qe.settings.borderRadius,delete Qe.settings.borderSize,delete Qe.settings.formPadding,delete Qe.settings.inputPadding,delete Qe.settings.borderColor,delete Qe.settings.backgroundImageUrl,delete Qe.settings.backgroundImageDisplay,delete Qe.settings.fontFamily,delete Qe.settings.closeButton,Qe}function JF(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function QF(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function ej(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*tj(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function nj(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function rj(e){return{type:"CHANGE_FORM_NAME",name:e}}function oj(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function ij(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function lj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"DELETE_CUSTOM_FIELD_FAILED",message:e}}function aj(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function sj(){return{type:"CUSTOM_FIELD_EDITED"}}function cj(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function uj(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function dj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"SAVE_CUSTOM_FIELD_FAILED",message:e}}function pj(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function mj(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function fj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"CREATE_CUSTOM_FIELD_FAILED",message:e}}function hj(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*gj(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function vj(){return{type:"SAVE_FORM_STARTED"}}function bj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return{type:"SAVE_FORM_FAILED",message:e}}function yj(e){return"placement_settings"===e&&(0,$.dispatch)(ku).clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*_j(e){const t=(0,$.select)(WF).getFormData();null!==t.id&&(yield{type:"STORE_LOCALLY",key:`mailpoet_form_preview_settings${t.id}`,value:e}),yield{type:"CHANGE_PREVIEW_SETTINGS",settings:e}}function*kj(e){const t={...(0,$.select)(WF).getPreviewSettings(),formType:e};return yield*_j(t),yj("placement_settings")}function*xj(){yield{type:"SHOW_PREVIEW"},yield yj("default");const e=(0,$.select)(WF).getAllAvailableCustomFields(),t=(0,$.select)(WF).getFormData(),n=(0,$.select)(WF).getFormBlocks(),r=YF($F,Uo.colors,Uo.gradients,e),{success:o,error:i}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...XF(t),body:r(n)}};return o?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:i}}function wj(){return{type:"HIDE_PREVIEW"}}function Cj(e){return{type:"REMOVE_NOTICE",id:e}}function Ej(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function Sj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:t}}function*Ij(){yield{type:"SAVE_FORM"}}function*Tj(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*Nj(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*Bj(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*Lj(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*Pj(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function Aj(){return{type:"HISTORY_UNDO"}}function Dj(){return{type:"HISTORY_REDO"}}function*Rj(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const Mj=(e,t)=>e.reduce(((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?Mj(n.innerBlocks,t):null)),null),Oj=(e,t)=>{if(!e||!e.settings||!Array.isArray(e.settings.segments))throw new Error("formData.settings.segments are expected to be an array.");if(!Array.isArray(t))throw new Error("formBlocks are expected to be an array.");const n=Mj(t,"mailpoet-form/segment-select"),r=[];n&&0!==n.attributes.values.length||e.settings.segments&&0!==e.settings.segments.length||r.push("missing-lists"),n&&0===n.attributes.values.length&&r.push("missing-lists-in-custom-segments-block");const o=Mj(t,"mailpoet-form/email-input"),i=Mj(t,"mailpoet-form/submit-button");return o||r.push("missing-email-input"),i||r.push("missing-submit"),r},Zj=e=>{let t=e.editorHistory,n=e.editorHistoryOffset;const r=((e,t)=>{const n=e[e.length-1],r=Date.now();if(void 0!==n&&r-n.time<1e3&&e.length>1)return e.pop(),{blocks:t.formBlocks,data:t.formData,time:n.time};const o={blocks:t.formBlocks,data:t.formData,time:r};return void 0!==n&&(0,U.isEqual)(n.data,o.data)&&(0,U.isEqual)(n.blocks,o.blocks)?null:o})(t,e);if(null===r)return e;if(0!==e.editorHistoryOffset){const r=e.editorHistory.length-(e.editorHistoryOffset+1);n=0,t=t.slice(0,r)}return t.length>=100&&t.shift(),t.push(r),{...e,editorHistory:t,editorHistoryOffset:n}},Fj=(e,t)=>{let n=e.editorHistoryOffset;0===n&&Zj(e),n+=t;const r=e.editorHistory.length-(n+1);let o,i;if(void 0===e.editorHistory[r])return e;{const t=e.editorHistory[r];o=t.blocks,i=t.data}return{...e,editorHistoryOffset:n,formBlocks:o,formData:i}},jj=(zj=OF.x,(e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id)),r=(0,U.trim)(t.customField.name),o=e.customFields.find((e=>e.name===r));return o&&n.push({id:"custom-field",content:zj.I18n.t("customFieldWithNameExists").replace("[name]",r),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!o,notices:n}});var zj;const Hj=(e=>t=>{const n=t.notices.filter((e=>!["missing-lists-in-custom-segments-block","save-form","missing-lists","missing-block"].includes(e.id))),r=t.formErrors.includes("missing-lists")||t.formErrors.includes("missing-lists-in-custom-segments-block"),o=[...t.sidebar.openedPanels];r&&(n.push({id:"missing-lists",content:e.I18n.t("settingsPleaseSelectList"),isDismissible:!0,status:"error"}),o.includes("basic-settings")||o.push("basic-settings"));const i=t.formErrors.includes("missing-email-input"),l=t.formErrors.includes("missing-submit");return(i||l)&&n.push({id:"missing-block",content:e.I18n.t("missingObligatoryBlock"),isDismissible:!0,status:"error"}),{...t,isFormSaving:!r,sidebar:{...t.sidebar,activeTab:r?"form":t.sidebar.activeTab,openedPanels:o},notices:n}})(OF.x),Vj=(e,t)=>{switch(t.type){case"ENABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"enabled"}}))(e);case"DISABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"disabled"}}))(e);case"TOGGLE_FULLSCREEN":return((e,t)=>({...e,fullscreenStatus:t.toggleTo}))(e,t);case"CREATE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:OF.x.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=[...e.customFields];return r.push(t.response),{...e,isCustomFieldCreating:!1,notices:n,customFields:r}})(e,t);case"CREATE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!1,notices:n}})(e,t);case"CREATE_CUSTOM_FIELD_STARTED":return jj(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:Oj(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_NAME":return((e,t)=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,name:t.name}}))(e,t);case"CHANGE_FORM_SETTINGS":return((e,t)=>{const n={...e,formData:{...e.formData,settings:t.settings}};return{...n,hasUnsavedChanges:!0,formErrors:Oj(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_STYLES":return((e,t)=>({...e,formData:{...e.formData,styles:t.styles,hasUnsavedChanges:!0}}))(e,t);case"CHANGE_PREVIEW_SETTINGS":return((e,t)=>{let{settings:n}=t;return{...e,previewSettings:n}})(e,t);case"CUSTOM_FIELD_EDITED":return(e=>({...e,hasUnsavedChanges:!0}))(e);case"REMOVE_NOTICE":return((e,t)=>({...e,notices:[...e.notices].filter((e=>e.id!==t.id))}))(e,t);case"SHOW_PREVIEW":return(e=>({...e,isPreviewShown:!0}))(e);case"HIDE_PREVIEW":return(e=>({...e,isPreviewShown:!1,isPreviewReady:!1}))(e);case"PREVIEW_DATA_NOT_SAVED":return(e=>({...e,isPreviewReady:!1}))(e);case"PREVIEW_DATA_SAVED":return(e=>({...e,isPreviewReady:!0}))(e);case"SAVE_FORM_DONE":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:`${OF.x.I18n.t("formSaved")} ${OF.x.I18n.t("formSavedAppendix")}`,isDismissible:!0,status:"success"}),{...e,formData:{...e.formData,id:parseInt(t.formId,10)},isFormSaving:!1,hasUnsavedChanges:!1,notices:n}})(e,t);case"SAVE_FORM_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:t.message,isDismissible:!0,status:"error"}),{...e,isFormSaving:!1,notices:n}})(e,t);case"SAVE_FORM_STARTED":return Hj(e);case"SAVE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:OF.x.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=e.customFields.map((e=>e.id===t.customFieldId?t.response:e));return{...e,isCustomFieldSaving:!1,notices:n,customFields:r}})(e,t);case"SAVE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"SAVE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,isCustomFieldSaving:!0,notices:t}})(e);case"SWITCH_DEFAULT_SIDEBAR_TAB":return((e,t)=>({...e,sidebar:{...e.sidebar,activeTab:t.id}}))(e,t);case"TOGGLE_SIDEBAR":return((e,t)=>({...e,sidebarOpened:t.toggleTo}))(e,t);case"TOGGLE_INSERTER_SIDEBAR":return((e,t)=>{let n;return n=t.value?!0===t.value?{rootClientId:void 0,insertionIndex:void 0}:t.value:null,{...e,inserterPanel:n}})(e,t);case"TOGGLE_SIDEBAR_PANEL":return((e,t)=>{let n;!0===t.toggleTo&&(n="opened"),!1===t.toggleTo&&(n="closed");const r=[...e.sidebar.openedPanels],o=((e,t,n)=>{const r=e.includes(t);let o=n;return void 0===o&&(o=r?"closed":"opened"),r&&"closed"===o?"close":r||"opened"!==o?null:"open"})(r,t.id,n);return"open"===o?r.push(t.id):"close"===o&&(0,U.remove)(r,(e=>e===t.id)),{...e,sidebar:{...e.sidebar,openedPanels:r}}})(e,t);case"DELETE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,...t,isCustomFieldDeleting:!0}})(e);case"DELETE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.customFields.filter((e=>e.id!==t.customFieldId)),r=e.formBlocks.filter((e=>e.clientId!==t.clientId));return{...e,formBlocks:r,isCustomFieldDeleting:!1,customFields:n}})(e,t);case"DELETE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"CHANGE_ACTIVE_SIDEBAR":return((e,t)=>({...e,sidebar:{...e.sidebar,activeSidebar:t.sidebar}}))(e,t);case"HISTORY_UNDO":return(e=>Fj(e,1))(e);case"HISTORY_REDO":return(e=>Fj(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}},Wj=(e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?Zj(e):e,$j=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Wj(t,n);return Vj(r,n)},Uj=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.reduce(((e,r)=>{if(e.length)return e;if(Array.isArray(r.innerBlocks)&&r.innerBlocks.length){n.push(r);const e=r.innerBlocks.find((e=>e.clientId===t));return e?n:Uj(r.innerBlocks,t,n)}return[]}),[])},Gj={isFormSaved:e=>"number"==typeof e.formData.id,isFormEnabled:e=>"enabled"===e.formData.status,isFullscreenEnabled:e=>e.fullscreenStatus,isInserterOpened:e=>!!e.inserterPanel,getInserterPanelInsertPoint:e=>e.inserterPanel,getSidebarOpened:e=>e.sidebarOpened,getFormName:e=>e.formData.name,getFormData:e=>e.formData,getFormStyles:e=>e.formData.styles,getFormExports:e=>Object.fromEntries(Object.entries(e.formExports).map((t=>{let[n,r]=t;return[n,r.replace(":form_id:",`${e.formData.id}`)]}))),getFormSettings:e=>e.formData.settings,getAllAvailableSegments:e=>e.segments,getAllAvailableCustomFields:e=>e.customFields,getAllAvailablePages:e=>e.allWpPages.map((e=>({id:e.id,title:e.name}))),getIsFormSaving:e=>e.isFormSaving,getIsPreviewShown:e=>e.isPreviewShown,getIsPreviewReady:e=>e.isPreviewReady,getPreviewSettings(e){if(e.previewSettings)return e.previewSettings;const t={displayType:"desktop",formType:"others"},n=e.formData.settings;return n.formPlacement.belowPosts.enabled&&(t.formType="below_posts"),n.formPlacement.popup.enabled&&(t.formType="popup"),n.formPlacement.fixedBar.enabled&&(t.formType="fixed_bar"),n.formPlacement.slideIn.enabled&&(t.formType="slide_in"),t},getFormWidth(e,t){const n=e.formData.settings;switch(t){case"below_posts":return n.formPlacement.belowPosts.styles.width;case"popup":return n.formPlacement.popup.styles.width;case"slide_in":return n.formPlacement.slideIn.styles.width;case"fixed_bar":return n.formPlacement.fixedBar.styles.width;case"others":return n.formPlacement.others.styles.width;default:throw Error(`Invalid form display type ${t}`)}},getIsCustomFieldSaving:e=>e.isCustomFieldSaving,getIsCustomFieldDeleting:e=>e.isCustomFieldDeleting,getDismissibleNotices:e=>e.notices.filter((e=>!0===e.isDismissible)),getNonDismissibleNotices:e=>e.notices.filter((e=>!1===e.isDismissible)),getNotice:(e,t)=>e.notices.find((e=>e.id===t)),getFormErrors:e=>e.formErrors,getDefaultSidebarActiveTab:e=>e.sidebar.activeTab,getSidebarOpenedPanels:e=>e.sidebar.openedPanels,getFormBlocks:e=>e.formBlocks,getDateSettingsData:e=>e.dateSettingData,getIsCustomFieldCreating:e=>e.isCustomFieldCreating,hasUnsavedChanges:e=>e.hasUnsavedChanges,getEditorUrl:e=>e.editorUrl,getPreviewPageUrl:e=>e.previewPageUrl,getCloseIconsUrl:e=>e.closeIconsUrl,getAllCustomFonts:e=>e.customFonts,getActiveSidebar:e=>e.sidebar.activeSidebar,getAllWPPosts:e=>e.allWpPosts,getAllWPPages:e=>e.allWpPages,getAllWPCategories:e=>e.allWpCategories,getAllWPTags:e=>e.allWpTags,getAllWooCommerceProducts:e=>e.allWooCommerceProducts,getAllWooCommerceCategories:e=>e.allWooCommerceCategories,getAllWooCommerceTags:e=>e.allWooCommerceTags,getTutorialSeen:e=>e.tutorialSeen,getFormEditorUrl:e=>e.formEditorUrl,getTutorialUrl:e=>e.tutorialUrl,getClosestParentAttribute:(e,t,n)=>Uj(e.formBlocks,t).reduce(((e,t)=>t.attributes&&void 0!==t.attributes[n]?t.attributes[n]:e),null),hasEditorUndo(e){let t=e.editorHistory.length;return e.editorHistory.length>1&&(t-=1),t>0&&t>e.editorHistoryOffset},hasEditorRedo:e=>e.editorHistoryOffset>0,isUserAdministrator:e=>e.user.isAdministrator};function qj(e){for(var t=1;t{window.confirm(OF.x.I18n.t("customFieldDeleteConfirm"))&&n()}),[n]);return(0,zF.jsx)(Mo.ZP,{isDestructive:!0,isLink:!0,isBusy:t,onClick:r,className:"button-on-top",children:OF.x.I18n.t("customFieldDeleteCTA")})}function lz(e){let{label:t,mandatory:n,dateType:r,dateFormat:o,defaultToday:i,dateSettings:l,isSaving:a,onSave:s,isDeleting:c,onCustomFieldDelete:u,onChange:d}=e;const[p,m]=(0,v.useState)(t),[f,h]=(0,v.useState)(n),[g,b]=(0,v.useState)(i),[y,_]=(0,v.useState)(r),[k,x]=(0,v.useState)(o),w=(0,v.useMemo)((()=>({label:p,mandatory:f,dateType:y,dateFormat:k,defaultToday:g})),[p,f,y,k,g]),C=f!==n||g!==i||y!==r||k!==o||p!==t;return(0,v.useEffect)((()=>{d&&d(w,C)}),[w,d,C]),(0,zF.jsxs)("div",{className:"custom-field-settings",children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:p,"data-automation-id":"settings_custom_date_label_input",onChange:m}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:f,onChange:h}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("customFieldDefaultToday"),checked:g,onChange:b}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:y,onChange:e=>{_(e);const t=l.dateFormats[e];x(t[0])},options:l.dateTypes}),(()=>{const e=l.dateFormats[y];return Array.isArray(e)&&1===e.length?null:(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:k,onChange:e=>x(e),options:e.map((e=>({value:e,label:e})))})})(),s?(0,zF.jsx)(Mo.ZP,{isPrimary:!0,onClick:()=>s({mandatory:f,dateType:y,dateFormat:k,defaultToday:g,label:p}),isBusy:a,disabled:a||!C,className:"button-on-top","data-automation-id":"custom_field_save",children:OF.x.I18n.t("customFieldSaveCTA")}):null,u?(0,zF.jsx)(iz,{isBusy:a||c,onDelete:u}):null]})}iz.propTypes={isBusy:jF().bool,onDelete:jF().func},iz.defaultProps={isBusy:!1,onDelete:()=>{}},lz.propTypes={mandatory:jF().bool,label:jF().string,dateType:jF().string,dateFormat:jF().string,defaultToday:jF().bool,onSave:jF().func,isSaving:jF().bool,dateSettings:jF().shape({dateTypes:jF().arrayOf(jF().shape({label:jF().string,value:jF().string})),dateFormats:jF().objectOf(jF().arrayOf(jF().string)),months:jF().arrayOf(jF().string)}).isRequired,isDeleting:jF().bool,onCustomFieldDelete:jF().func,onChange:jF().func},lz.defaultProps={label:"",mandatory:!1,isSaving:!1,dateType:null,dateFormat:null,defaultToday:!1,isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const az=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function sz(e){const t=[];void 0!==e.placeholder&&t.push((0,zF.jsx)("option",{value:"",children:e.placeholder},0));const n=rz()().year();for(let e=n;e>=n-100;e-=1)t.push((0,zF.jsx)("option",{value:e,children:e},e));return(0,zF.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:w()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function cz(e){const t=[];void 0!==e.placeholder&&t.push((0,zF.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,zF.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,zF.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:w()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function uz(e){const t=[];void 0!==e.placeholder&&t.push((0,zF.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,zF.jsx)("option",{value:e,children:e},e));return(0,zF.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:w()({mailpoet_date_day:e.addDefaultClasses}),children:t})}sz.propTypes={name:jF().string.isRequired,placeholder:jF().string.isRequired,onValueChange:jF().func.isRequired,year:jF().oneOfType([jF().string,jF().number]).isRequired,addDefaultClasses:jF().bool.isRequired},cz.propTypes={name:jF().string.isRequired,placeholder:jF().string.isRequired,onValueChange:jF().func.isRequired,month:jF().oneOfType([jF().string,jF().number]).isRequired,monthNames:jF().arrayOf(jF().string).isRequired,addDefaultClasses:jF().bool.isRequired},uz.propTypes={name:jF().string.isRequired,placeholder:jF().string.isRequired,onValueChange:jF().func.isRequired,day:jF().oneOfType([jF().string,jF().number]).isRequired,addDefaultClasses:jF().bool.isRequired};class dz extends v.Component{constructor(e){super(e),this.state={year:"",month:"",day:""},this.onValueChange=this.onValueChange.bind(this)}componentDidMount(){this.extractDateParts()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}onValueChange(e){const t=e.target.name.match(/(.*?)\[(.*?)\]/);let n=null,r=null;if(null!==t&&3===t.length){[,n,r]=t;const o=Number(e.target.value);this.setState({[`${r}`]:o},(()=>{this.props.onValueChange({target:{name:n,value:this.formatValue()}})}))}}formatValue(){let e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}extractDateParts(){const e=void 0!==this.props.item[this.props.field.name]?this.props.item[this.props.field.name].trim():"";if(""===e)return;const t=rz()(e);this.setState({year:t.format("YYYY"),month:t.format("M"),day:t.format("D")})}render(){const e=window.mailpoet_month_names||[];let t=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(t=this.props.field.params.date_format);const n=t.split("/").map((t=>{switch(t){case"YYYY":return(0,zF.jsx)(sz,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,year:this.state.year,placeholder:this.props.field.year_placeholder},"year");case"MM":return(0,zF.jsx)(cz,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,month:this.state.month,monthNames:e,placeholder:this.props.field.month_placeholder},"month");case"DD":return(0,zF.jsx)(uz,{onValueChange:this.onValueChange,name:this.props.field.name,addDefaultClasses:this.props.addDefaultClasses,day:this.state.day,placeholder:this.props.field.day_placeholder},"day");default:return(0,zF.jsx)("div",{children:"Invalid date type"})}}));return(0,zF.jsx)("div",{children:n})}}function pz(e){let{children:t,className:n}=e;return(0,zF.jsx)("div",{className:w()("mailpoet_paragraph",n),children:t})}function mz(e,t){switch(e){case"checkbox":return{label:t.label,required:t.mandatory?"1":"",values:[{is_checked:t.isChecked?"1":"",value:t.checkboxLabel}]};case"date":return{label:t.label,required:t.mandatory?"1":"",date_type:t.dateType,date_format:t.dateFormat,is_default_today:t.defaultToday?"1":""};case"radio":case"select":return{required:t.mandatory?"1":"",label:t.label,values:t.values.map((e=>{const t={value:e.name};return e.isChecked?t.is_checked="1":t.is_checked="",t}))};case"text":return{required:t.mandatory?"1":"",validate:t.validate,label:t.label};case"textarea":return{required:t.mandatory?"1":"",validate:t.validate,lines:t.lines?t.lines:"1",label:t.label};default:throw new Error(`Invalid custom field type ${e}!`)}}function fz(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),i=(0,E.Z)((e=>e(WF).getDateSettingsData()),[]),l=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,S.Z)(WF),u=(0,zF.jsx)(nh,{children:(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)(lz,{label:t.label,mandatory:t.mandatory,dateSettings:i,defaultToday:t.defaultToday,dateFormat:t.dateFormat,dateType:t.dateType,isSaving:o,onSave:e=>a({customFieldId:t.customFieldId,data:{params:mz("date",e)},onFinish:()=>n({mandatory:e.mandatory,dateType:e.dateType,dateFormat:e.dateFormat,defaultToday:e.defaultToday,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})})});return(0,zF.jsx)(pz,{className:t.className,children:(0,zF.jsxs)("div",{className:"mailpoet_custom_date",children:[u,(0,zF.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:r,children:az(t)}),(0,zF.jsx)(dz,{field:{name:r,day_placeholder:OF.x.I18n.t("customFieldDay"),month_placeholder:OF.x.I18n.t("customFieldMonth"),year_placeholder:OF.x.I18n.t("customFieldYear"),params:{date_type:t.dateType,date_format:t.dateFormat}},item:{[r]:t.defaultToday?rz()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function hz(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},defaultToday:{type:"boolean",default:!1},dateType:{type:"string",default:e.params.date_type},dateFormat:{type:"string",default:e.params.date_format},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:fz,save:()=>null}}dz.propTypes={item:jF().object.isRequired,field:jF().shape({name:jF().string,day_placeholder:jF().string,month_placeholder:jF().string,year_placeholder:jF().string,params:jF().object}).isRequired,onValueChange:jF().func.isRequired,addDefaultClasses:jF().bool},dz.defaultProps={addDefaultClasses:!1},pz.propTypes={children:jF().node.isRequired,className:jF().string},pz.defaultProps={className:""},fz.propTypes={attributes:jF().shape({label:jF().string.isRequired,dateFormat:jF().string.isRequired,dateType:jF().string.isRequired,defaultToday:jF().bool,mandatory:jF().bool.isRequired,customFieldId:jF().number.isRequired,className:jF().string}).isRequired,clientId:jF().string.isRequired,setAttributes:jF().func.isRequired};const gz={fullWidth:!0,inheritFromTheme:!0},vz={fullWidth:!1,inheritFromTheme:!0},bz=e=>{if(!e)return vz;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,U.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,U.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,U.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,U.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,U.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number(e.font_size)),(0,U.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,U.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,U.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,U.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,U.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},yz=(e,t)=>{const n=e.find((e=>e.color===t));return n?n.slug:void 0},_z=(e,t)=>{const n=e.find((e=>e.gradient===t));return n?n.slug:void 0},kz=(e,t)=>{const n=e.find((e=>e.size===t));return n?n.slug:void 0};function xz(e){let{label:t,mandatory:n,validate:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,fieldType:c}=e;const[u,d]=(0,v.useState)(t),[p,m]=(0,v.useState)(n),[f,h]=(0,v.useState)(r),g=(0,v.useMemo)((()=>({label:u,mandatory:p,validate:f})),[u,p,f]),b=p!==n||f!==r||u!==t;return(0,v.useEffect)((()=>{s&&s(g,b)}),[g,s,b,c]),(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,zF.jsx)(BT.Z,{label:`${OF.x.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:OF.x.I18n.t("customFieldValidateNothing"),value:""},{label:OF.x.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:OF.x.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:OF.x.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:f,onChange:h}),i?(0,zF.jsx)(Mo.ZP,{isPrimary:!0,onClick:()=>i(g),isBusy:o,disabled:o||l||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:OF.x.I18n.t("customFieldSaveCTA")}):null,a?(0,zF.jsx)(iz,{isBusy:o||l,onDelete:a}):null]})}xz.propTypes={label:jF().string,mandatory:jF().bool,validate:jF().string,onSave:jF().func,isSaving:jF().bool,isDeleting:jF().bool,onCustomFieldDelete:jF().func,onChange:jF().func,fieldType:jF().string},xz.defaultProps={label:"",mandatory:!1,fieldType:"",isSaving:!1,validate:"",isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null};const wz=["colors","disableCustomColors","gradients","disableCustomGradients"],Cz=e=>{let{className:t,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,children:l,settings:a,title:s,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d}=e;const p=(0,dd.Z)(Cz),{batch:m}=(0,yl.Z)();return(0,U.isEmpty)(n)&&(0,U.isEmpty)(r)&&o&&i&&null!=a&&a.every((e=>(0,U.isEmpty)(e.colors)&&(0,U.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?null:(0,v.createElement)(Yf,{className:w()("block-editor-panel-color-gradient-settings",t),label:c?s:void 0,resetAll:()=>{m((()=>{a.forEach((e=>{let{colorValue:t,gradientValue:n,onColorChange:r,onGradientChange:o}=e;t?r():n&&o()}))}))},panelId:p,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},(0,v.createElement)(AL,{settings:a,panelId:p,colors:n,gradients:r,disableCustomColors:o,disableCustomGradients:i,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!l&&(0,v.createElement)(v.Fragment,null,(0,v.createElement)(cw.Z,{marginY:4})," ",l))},Ez=e=>{const t=IB();return(0,v.createElement)(Cz,(0,Po.Z)({},t,e))};var Sz=e=>wz.every((t=>e.hasOwnProperty(t)))?(0,v.createElement)(Cz,e):(0,v.createElement)(Ez,e);function Iz(e){let{title:t,settings:n}=e;const r=bp("color.palette"),o=bp("color.gradients");return(0,zF.jsx)("div",{children:(0,zF.jsx)(Sz,{title:t,colors:r,gradients:o,settings:n})})}Iz.displayName="ColorGradientSettings";const Tz=(0,MF.withBoundary)(Iz);function Nz(e){let{styles:t,onChange:n}=e;const r=(0,v.useRef)(t),o=r.current,{applyStylesToAllTextInputs:i}=(0,S.Z)(WF),l=(e,t)=>{const o={...r.current};o[e]=t,n(o),r.current=o};return(0,zF.jsx)(oz.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,zF.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsDisplayFullWidth"),checked:o.fullWidth,onChange:(0,U.partial)(l,"fullWidth")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:o.inheritFromTheme,onChange:e=>{if(e)return void l("inheritFromTheme",e);const t={...r.current};t.backgroundColor="#ffffff",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.inheritFromTheme=e,n(t),r.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),o.inheritFromTheme?null:(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(Tz,{title:OF.x.I18n.t("formSettingsColor"),settings:[{label:OF.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,U.partial)(l,"fontColor")},{label:OF.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,onColorChange:(0,U.partial)(l,"backgroundColor")},{label:OF.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,U.partial)(l,"borderColor")}]}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsBold"),checked:o.bold||!1,onChange:(0,U.partial)(l,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderSize"),value:void 0===o.borderSize?1:o.borderSize,min:0,max:10,allowReset:!0,onChange:(0,U.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderRadius"),value:void 0===o.borderRadius?1:o.borderRadius,min:0,max:40,allowReset:!0,onChange:(0,U.partial)(l,"borderRadius")})]}),(0,zF.jsx)("div",{children:(0,zF.jsx)(Mo.ZP,{isPrimary:!0,onClick:()=>i(o),"data-automation-id":"styles_apply_to_all",children:OF.x.I18n.t("formSettingsApplyToAll")})})]})})})}const Bz=jF().shape({fullWidth:jF().bool.isRequired,inheritFromTheme:jF().bool.isRequired,bold:jF().bool,backgroundColor:jF().string,borderSize:jF().number,borderRadius:jF().number,borderColor:jF().string});let Lz;function Pz(e){return e===Lz.Right?"0 0 0 auto":e===Lz.Center?"0 auto":"auto 0"}function Az(e){let{label:t,labelWithinInput:n,name:r,mandatory:o,styles:i,className:l}=e;const a=(0,E.Z)((e=>e(WF).getFormSettings()),[]),s=(0,v.useRef)(null),c=`${r}_${Math.random().toString(36).substring(2,15)}`,[u,d]=(0,v.useState)(""),p=i.inheritFromTheme?{}:{fontWeight:i.bold?"bold":"inherit"},m=i.inheritFromTheme?{}:{borderRadius:i.borderRadius?`${i.borderRadius}px`:0,borderWidth:void 0!==i.borderSize?`${i.borderSize}px`:"1px",borderColor:i.borderColor||"initial",borderStyle:"solid"};void 0!==a.inputPadding&&(m.padding=a.inputPadding),void 0!==a.inputPadding&&(m.padding=a.inputPadding),void 0!==a.alignment&&(m.textAlign=a.alignment,m.margin=Pz(m.textAlign)),i.fullWidth&&(m.width="100%"),i.backgroundColor&&!i.inheritFromTheme&&(m.backgroundColor=i.backgroundColor);const f={};return i.fontColor&&!i.inheritFromTheme&&(m.color=i.fontColor,n&&(f.color=i.fontColor)),(0,zF.jsxs)(pz,{className:l,children:[n?null:(0,zF.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${r}_label`,htmlFor:c,style:p,children:az({label:t,mandatory:o})}),(e=>{let t=`#${c}::placeholder {`;return void 0!==f.color&&(t+=`color: ${f.color};`),a.fontFamily&&(t+=`font-family: ${a.fontFamily};`),t+="}",(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("style",{children:t}),(0,zF.jsx)("input",{id:c,ref:s,className:"mailpoet_text",type:"text",name:r,value:u,onChange:()=>d(""),placeholder:e,"data-automation-id":`editor_${r}_input`,style:m,autoComplete:"off"})]})})(n?az({label:t,mandatory:o}):"")]})}function Dz(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),i=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,S.Z)(WF),c=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)(xz,{updateAttributes:e=>n(e),customFieldId:t.customFieldId,label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:o,onSave:e=>{l({customFieldId:t.customFieldId,data:{params:mz("text",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,label:e.label})})},onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})}),(0,zF.jsx)(Nz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,zF.jsxs)(zF.Fragment,{children:[c,(0,zF.jsx)(Az,{className:t.className,name:"custom_text",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}function Rz(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:gz}},supports:{html:!1,multiple:!1},edit:Dz,save:()=>null}}function Mz(e){let{name:t,attributes:n,setAttributes:r,clientId:o}=e;const i=`${t.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,l=(0,E.Z)((e=>e(WF).getFormSettings()),[]),a=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),s=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),[c,u]=(0,v.useState)(""),{saveCustomField:d,deleteCustomField:p,customFieldEdited:m}=(0,S.Z)(WF),f=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)(xz,{label:n.label,mandatory:n.mandatory,validate:n.validate,isSaving:a,onSave:e=>d({customFieldId:n.customFieldId,data:{params:mz("textarea",e)},onFinish:()=>r({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>p(n.customFieldId,o),isDeleting:s,onChange:(e,t)=>t&&m()})})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:n.labelWithinInput,onChange:e=>r({labelWithinInput:e})}),(0,zF.jsx)(BT.Z,{label:`${OF.x.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:n.lines,options:[{label:OF.x.I18n.t("customField1Line"),value:"1"},{label:OF.x.I18n.t("customField2Lines"),value:"2"},{label:OF.x.I18n.t("customField3Lines"),value:"3"},{label:OF.x.I18n.t("customField4Lines"),value:"4"},{label:OF.x.I18n.t("customField5Lines"),value:"5"}],onChange:e=>r({lines:e})})]})}),(0,zF.jsx)(Nz,{styles:n.styles,onChange:e=>r({styles:e})})]}),h=n.styles.inheritFromTheme?{}:{fontWeight:n.styles.bold?"bold":"inherit"},g=n.styles.inheritFromTheme?{}:{borderRadius:n.styles.borderRadius?`${n.styles.borderRadius}px`:0,borderWidth:void 0!==n.styles.borderSize?`${n.styles.borderSize}px`:"1px",borderColor:n.styles.borderColor||"initial",borderStyle:"solid"};n.styles.fullWidth&&(g.width="100%"),n.styles.backgroundColor&&!n.styles.inheritFromTheme&&(g.backgroundColor=n.styles.backgroundColor),void 0!==l.inputPadding&&(g.padding=l.inputPadding),void 0!==l.alignment&&(g.textAlign=l.alignment,g.margin=Pz(g.textAlign)),g.resize="none";const b={};n.styles.fontColor&&!n.styles.inheritFromTheme&&(g.color=n.styles.fontColor,n.labelWithinInput&&(b.color=n.styles.fontColor));const y=(0,v.useRef)(null),_=e=>{let t=`#${i}::placeholder {`;return void 0!==b.color&&(t+=`color: ${b.color};`),l.fontFamily&&(t+=`font-family: ${l.fontFamily};`),t+="}",(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("style",{children:t}),(0,zF.jsx)("textarea",{id:i,ref:y,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:n.lines,style:g,onChange:()=>u(""),placeholder:e,value:c})]})};return(0,zF.jsxs)(pz,{className:n.className,children:[f,n.labelWithinInput?_(az(n)):(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:i,style:h,children:az(n)}),_("")]})]})}function Oz(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},lines:{type:"string",default:"1"},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:gz}},supports:{html:!1,multiple:!1},edit:Mz,save:()=>null}}!function(e){e.Left="left",e.Center="center",e.Right="right"}(Lz||(Lz={})),Az.propTypes={label:jF().string.isRequired,labelWithinInput:jF().bool.isRequired,name:jF().string.isRequired,mandatory:jF().bool.isRequired,className:jF().string,styles:Bz.isRequired},Az.defaultProps={className:""},Dz.propTypes={attributes:jF().shape({label:jF().string.isRequired,validate:jF().string,labelWithinInput:jF().bool.isRequired,mandatory:jF().bool.isRequired,customFieldId:jF().number.isRequired,styles:Bz.isRequired,className:jF().string}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired},Mz.propTypes={attributes:jF().shape({label:jF().string.isRequired,customFieldId:jF().number.isRequired,validate:jF().string,labelWithinInput:jF().bool.isRequired,mandatory:jF().bool.isRequired,lines:jF().string,styles:Bz.isRequired,className:jF().string}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired,name:jF().string.isRequired};var Zz=n(81488),Fz=n(61004),jz=n(86215),zz=n(72930),Hz=v.createContext(null),Vz=function(e){e()},Wz=function(){return Vz},$z={notify:function(){}},Uz=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=$z,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=Wz(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=$z)},e}(),Gz=function(e){var t=e.store,n=e.context,r=e.children,o=(0,v.useMemo)((function(){var e=new Uz(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),i=(0,v.useMemo)((function(){return t.getState()}),[t]);(0,v.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var l=n||Hz;return v.createElement(l.Provider,{value:o},r)},qz=n(92897),Kz=n(26095),Yz=n.n(Kz),Xz=n(65566),Jz="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?v.useLayoutEffect:v.useEffect,Qz=[],eH=[null,null];function tH(e,t){var n=e[1];return[t.payload,n+1]}function nH(e,t,n){Jz((function(){return e.apply(void 0,t)}),n)}function rH(e,t,n,r,o,i,l){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,l())}function oH(e,t,n,r,o,i,l,a,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?l.current||s():(i.current=e,a.current=e,l.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var iH=function(){return[null,0]};function lH(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,l=void 0===i?"connectAdvanced":i,a=n.renderCountProp,s=void 0===a?void 0:a,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,p=void 0===d?"store":d,m=(n.withRef,n.forwardRef),f=void 0!==m&&m,h=n.context,g=void 0===h?Hz:h,b=(0,qz.Z)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),y=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=(0,xM.Z)({},b,{getDisplayName:o,methodName:l,renderCountProp:s,shouldHandleStateChanges:u,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),a=b.pure,c=a?v.useMemo:function(e){return e()};function d(n){var r=(0,v.useMemo)((function(){var e=n.forwardedRef,t=(0,qz.Z)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],l=r[1],a=r[2],s=(0,v.useMemo)((function(){return o&&o.Consumer&&(0,Xz.isContextConsumer)(v.createElement(o.Consumer,null))?o:y}),[o,y]),d=(0,v.useContext)(s),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var m=p?n.store:d.store,f=(0,v.useMemo)((function(){return function(t){return e(t.dispatch,i)}(m)}),[m]),h=(0,v.useMemo)((function(){if(!u)return eH;var e=new Uz(m,p?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[m,p,d]),g=h[0],b=h[1],_=(0,v.useMemo)((function(){return p?d:(0,xM.Z)({},d,{subscription:g})}),[p,d,g]),k=(0,v.useReducer)(tH,Qz,iH),x=k[0][0],w=k[1];if(x&&x.error)throw x.error;var C=(0,v.useRef)(),E=(0,v.useRef)(a),S=(0,v.useRef)(),I=(0,v.useRef)(!1),T=c((function(){return S.current&&a===E.current?S.current:f(m.getState(),a)}),[m,x,a]);nH(rH,[E,C,I,a,T,S,b]),nH(oH,[u,m,g,f,E,C,I,S,b,w],[m,g,f]);var N=(0,v.useMemo)((function(){return v.createElement(t,(0,xM.Z)({},T,{ref:l}))}),[l,t,T]);return(0,v.useMemo)((function(){return u?v.createElement(s.Provider,{value:_},N):N}),[s,N,_])}var m=a?v.memo(d):d;if(m.WrappedComponent=t,m.displayName=r,f){var h=v.forwardRef((function(e,t){return v.createElement(m,(0,xM.Z)({},e,{forwardedRef:t}))}));return h.displayName=r,h.WrappedComponent=t,Yz()(h,t)}return Yz()(m,t)}}function aH(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function sH(e,t){if(aH(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function _H(e,t){return e===t}function kH(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?lH:n,o=t.mapStateToPropsFactories,i=void 0===o?mH:o,l=t.mapDispatchToPropsFactories,a=void 0===l?pH:l,s=t.mergePropsFactories,c=void 0===s?hH:s,u=t.selectorFactory,d=void 0===u?bH:u;return function(e,t,n,o){void 0===o&&(o={});var l=o,s=l.pure,u=void 0===s||s,p=l.areStatesEqual,m=void 0===p?_H:p,f=l.areOwnPropsEqual,h=void 0===f?sH:f,g=l.areStatePropsEqual,v=void 0===g?sH:g,b=l.areMergedPropsEqual,y=void 0===b?sH:b,_=(0,qz.Z)(l,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),k=yH(e,i,"mapStateToProps"),x=yH(t,a,"mapDispatchToProps"),w=yH(n,c,"mergeProps");return r(d,(0,xM.Z)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:x,initMergeProps:w,pure:u,areStatesEqual:m,areOwnPropsEqual:h,areStatePropsEqual:v,areMergedPropsEqual:y},_))}}var xH,wH=kH();xH=b.unstable_batchedUpdates,Vz=xH;var CH=n(34986),EH=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},SH=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},IH=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},TH={top:0,right:0,bottom:0,left:0},NH=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?TH:n,o=e.border,i=void 0===o?TH:o,l=e.padding,a=void 0===l?TH:l,s=EH(SH(t,r)),c=EH(IH(t,i)),u=EH(IH(c,a));return{marginBox:s,borderBox:EH(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:a}},BH=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&(0,CH.Z)(!1),n},LH=function(e,t){var n,r,o=e.borderBox,i=e.border,l=e.margin,a=e.padding,s=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return NH({borderBox:s,border:i,margin:l,padding:a})},PH=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),LH(e,t)},AH=function(e,t){var n={top:BH(t.marginTop),right:BH(t.marginRight),bottom:BH(t.marginBottom),left:BH(t.marginLeft)},r={top:BH(t.paddingTop),right:BH(t.paddingRight),bottom:BH(t.paddingBottom),left:BH(t.paddingLeft)},o={top:BH(t.borderTopWidth),right:BH(t.borderRightWidth),bottom:BH(t.borderBottomWidth),left:BH(t.borderLeftWidth)};return NH({borderBox:e,margin:n,padding:r,border:o})},DH=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return AH(t,n)},RH=n(84471),MH=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}(0,Fz.Z)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=FH(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof jH))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(v.Component),VH=function(e){return e+1},WH=function(e,t){var n=e.droppableId===t.droppableId,r=VH(e.index),o=VH(t.index);return n?"\n You have moved the item from position "+r+"\n to position "+o+"\n ":"\n You have moved the item from position "+r+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+o+"\n "},$H=function(e,t,n){return t.droppableId===n.droppableId?"\n The item "+e+"\n has been combined with "+n.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+n.draggableId+"\n in list "+n.droppableId+"\n "},UH=function(e){return"\n The item has returned to its starting position\n of "+VH(e.index)+"\n"},GH=function(e){return"\n You have lifted an item in position "+VH(e.source.index)+"\n"},qH=function(e){var t=e.destination;if(t)return WH(e.source,t);var n=e.combine;return n?$H(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},KH=function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+UH(e.source)+"\n ";var t=e.destination,n=e.combine;return t?"\n You have dropped the item.\n "+WH(e.source,t)+"\n ":n?"\n You have dropped the item.\n "+$H(e.draggableId,e.source,n)+"\n ":"\n The item has been dropped while not over a drop area.\n "+UH(e.source)+"\n "},YH={x:0,y:0},XH=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},JH=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},QH=function(e,t){return e.x===t.x&&e.y===t.y},eV=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},tV=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},nV=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},rV=function(e,t){return Math.min.apply(Math,t.map((function(t){return nV(e,t)})))},oV=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},iV=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},lV=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},aV=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=EH({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):EH(e)},sV=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,o=e.frame,i=function(e,t){return t?iV(e,t.scroll.diff.displacement):e}(t.marginBox,o),l=function(e,t,n){var r;return n&&n.increasedBy?(0,jz.Z)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(i,r,n);return{page:t,withPlaceholder:n,active:aV(l,o)}},cV=function(e,t){e.frame||zH(!1);var n=e.frame,r=JH(t,n.scroll.initial),o=eV(r),i=(0,jz.Z)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}}),l=sV({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return(0,jz.Z)({},e,{frame:i,subject:l})};function uV(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function dV(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;ne.bottom,a=r.lefte.right;return!(!l||!a)||l&&i||a&&o}},TV=function(e){var t=SV(e.top,e.bottom),n=SV(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},NV={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},BV={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},LV=function(e){var t=e.target,n=e.destination,r=e.viewport,o=e.withDroppableDisplacement,i=e.isVisibleThroughFrameFn,l=o?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:YH;return iV(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(l,n,i)&&function(e,t,n){return n(t)(e)}(l,r,i)},PV=function(e){return LV((0,jz.Z)({},e,{isVisibleThroughFrameFn:TV}))};function AV(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,o=e.viewport,i=e.forceShouldAnimate,l=e.last;return t.reduce((function(e,t){var a,s=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return EH(SH(n,r))}(t,r),c=t.descriptor.id;if(e.all.push(c),a={target:s,destination:n,viewport:o,withDroppableDisplacement:!0},!LV((0,jz.Z)({},a,{isVisibleThroughFrameFn:IV})))return e.invisible[t.descriptor.id]=!0,e;var u=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,o=t.visible;if(r[e])return!1;var i=o[e];return!i||i.shouldAnimate}(c,l,i),d={draggableId:c,shouldAnimate:u};return e.visible[c]=d,e}),{all:[],visible:{},invisible:{}})}function DV(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,o=e.destination,i=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:CV,displacedBy:r,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:i}}}}function RV(e){var t=e.draggable,n=e.insideDestination,r=e.destination,o=e.viewport,i=e.displacedBy,l=e.last,a=e.index,s=e.forceShouldAnimate,c=xV(t,r);if(null==a)return DV({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var u=pV(n,(function(e){return e.descriptor.index===a}));if(!u)return DV({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var d=kV(t,n),p=n.indexOf(u);return{displaced:AV({afterDragging:d.slice(p),destination:r,displacedBy:i,last:l,viewport:o.frame,forceShouldAnimate:s}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function MV(e,t){return Boolean(t.effected[e])}var OV=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},ZV=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},FV=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return tV(t.line,n.marginBox[t.end]+OV(t,r),ZV(t,n.marginBox,r))},jV=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return tV(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),ZV(t,n.marginBox,r))},zV=function(e,t){var n=e.frame;return n?XH(t,n.scroll.diff.displacement):t},HV=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.afterCritical,l=n.page.borderBox.center,a=t.at;return r&&a?"REORDER"===a.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,o=e.droppable,i=e.afterCritical,l=bV(o.descriptor.id,r),a=n.page,s=o.axis;if(!l.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return tV(t.line,n.contentBox[t.start]+OV(t,r),ZV(t,n.contentBox,r))}({axis:s,moveInto:o.page,isMoving:a});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=r[d];if(MV(d,i))return jV({axis:s,moveRelativeTo:p.page,isMoving:a});var m=LH(p.page,u.point);return jV({axis:s,moveRelativeTo:m,isMoving:a})}var f=l[l.length-1];if(f.descriptor.id===n.descriptor.id)return a.borderBox.center;if(MV(f.descriptor.id,i)){var h=LH(f.page,eV(i.displacedBy.point));return FV({axis:s,moveRelativeTo:h,isMoving:a})}return FV({axis:s,moveRelativeTo:f.page,isMoving:a})}({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:i}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,o=_V(n);o||zH(!1);var i=o.draggableId,l=r[i].page.borderBox.center,a=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,o=e.displacedBy,i=Boolean(t.visible[r]||t.invisible[r]);return MV(r,n)?i?YH:eV(o.point):i?o.point:YH}({displaced:n.displaced,afterCritical:t,combineWith:i,displacedBy:n.displacedBy});return XH(l,a)}({impact:t,draggables:o,afterCritical:i}):l}(e),n=e.droppable;return n?zV(n,t):t},VV=function(e,t){var n=JH(t,e.scroll.initial),r=eV(n);return{frame:EH({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function WV(e,t){return e.map((function(e){return t[e]}))}var $V=function(e){var t,n,r=e.pageBorderBoxCenter,o=e.draggable,i=(t=e.viewport,n=r,XH(t.scroll.diff.displacement,n)),l=JH(i,o.page.borderBox.center);return XH(o.client.borderBox.center,l)},UV=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,o=e.viewport,i=e.withDroppableDisplacement,l=e.onlyOnMainAxis,a=void 0!==l&&l,s=JH(r,t.page.borderBox.center),c={target:iV(t.page.borderBox,s),destination:n,withDroppableDisplacement:i,viewport:o};return a?function(e){return LV((0,jz.Z)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=SV(e.top,e.bottom),r=SV(e.left,e.right);return function(e){return t===NV?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):PV(c)},GV=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.draggables,i=e.previousImpact,l=e.viewport,a=e.previousPageBorderBoxCenter,s=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=bV(r.descriptor.id,o),d=xV(n,r),p=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.previousImpact;if(!r.isCombineEnabled)return null;if(!yV(i))return null;function l(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,jz.Z)({},i,{at:t})}var a=i.displaced.all,s=a.length?a[0]:null;if(t)return s?l(s):null;var c=kV(n,o);if(!s)return c.length?l(c[c.length-1].descriptor.id):null;var u=dV(c,(function(e){return e.descriptor.id===s}));-1===u&&zH(!1);var d=u-1;return d<0?null:l(c[d].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:i})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,o=e.draggables,i=e.destination,l=e.insideDestination,a=e.previousImpact,s=e.viewport,c=e.afterCritical,u=a.at;if(u||zH(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,o=e.location;if(!r.length)return null;var i=o.index,l=t?i+1:i-1,a=r[0].descriptor.index,s=r[r.length-1].descriptor.index;return l(n?s:s+1)?null:l}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:l});return null==d?null:RV({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:d})}var p=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,o=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var i=r.draggableId,l=n[i].descriptor.index;return MV(i,o)?t?l:l-1:t?l+1:l}({isMovingForward:t,destination:i,displaced:a.displaced,draggables:o,combine:u.combine,afterCritical:c});return null==p?null:RV({draggable:r,insideDestination:l,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:p})}({isMovingForward:t,isInHomeList:d,draggable:n,draggables:o,destination:r,insideDestination:u,previousImpact:i,viewport:l,afterCritical:c});if(!p)return null;var m=HV({impact:p,draggable:n,droppable:r,draggables:o,afterCritical:c});if(UV({draggable:n,destination:r,newPageBorderBoxCenter:m,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:$V({pageBorderBoxCenter:m,draggable:n,viewport:l}),impact:p,scrollJumpRequest:null};var f=JH(m,a),h=function(e){var t=e.impact,n=e.viewport,r=e.destination,o=e.draggables,i=e.maxScrollChange,l=VV(n,XH(n.scroll.current,i)),a=r.frame?cV(r,XH(r.frame.scroll.current,i)):r,s=t.displaced,c=AV({afterDragging:WV(s.all,o),destination:r,displacedBy:t.displacedBy,viewport:l.frame,last:s,forceShouldAnimate:!1}),u=AV({afterDragging:WV(s.all,o),destination:a,displacedBy:t.displacedBy,viewport:n.frame,last:s,forceShouldAnimate:!1}),d={},p={},m=[s,c,u];return s.all.forEach((function(e){var t=function(e,t){for(var n=0;n1?u.sort((function(e,t){return qV(e)[a.start]-qV(t)[a.start]}))[0]:c.sort((function(e,t){var r=rV(n,lV(qV(e))),o=rV(n,lV(qV(t)));return r!==o?r-o:qV(e)[a.start]-qV(t)[a.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:o,droppables:l,viewport:a});if(!c)return null;var u=bV(c.descriptor.id,i),d=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,o=e.afterCritical,i=e.insideDestination.filter((function(e){return PV({target:YV(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=nV(t,zV(r,KV(e,o))),l=nV(t,zV(r,KV(n,o)));return ir.left&&n.topr.top))return!1;if(rW(o)(t.center))return!0;var i=e.axis,l=o.center[i.crossAxisLine],a=t[i.crossAxisStart],s=t[i.crossAxisEnd],c=SV(o[i.crossAxisStart],o[i.crossAxisEnd]),u=c(a),d=c(s);return!u&&!d||(u?al)}));return o.length?1===o.length?o[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,o=n.map((function(e){var n=e.axis,o=tV(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:nV(r,o)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:n,candidates:o}):null}({pageBorderBox:s,draggable:n,droppables:o});if(!c)return EV;var u=o[c],d=bV(u.descriptor.id,r),p=function(e,t){var n=e.frame;return n?oW(t,n.scroll.diff.value):t}(u,s);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,o=e.destination,i=e.insideDestination,l=e.afterCritical;if(!o.isCombineEnabled)return null;var a=o.axis,s=XV(o.axis,t.displaceBy),c=s.value,u=n[a.start],d=n[a.end],p=pV(kV(t,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox,o=n[a.size]/4,i=MV(t,l),s=iW({displaced:r.displaced,id:t});return i?s?d>n[a.start]+o&&dn[a.start]-c+o&&un[a.start]+c+o&&dn[a.start]+o&&ut.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:m,inHomeList:xV(n,r)});return RV({draggable:n,insideDestination:o,destination:r,viewport:l,last:i,displacedBy:c,index:f})}({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:u,insideDestination:d,last:i.displaced,viewport:l,afterCritical:a})},aW=function(e,t){var n;return(0,jz.Z)({},e,((n={})[t.descriptor.id]=t,n))},sW=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,o=e.viewport,i=e.impact,l=e.scrollJumpRequest,a=o||t.viewport,s=r||t.dimensions,c=n||t.current.client.selection,u=JH(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:XH(t.initial.client.borderBoxCenter,u)},p={selection:XH(d.selection,a.scroll.current),borderBoxCenter:XH(d.borderBoxCenter,a.scroll.current),offset:XH(d.offset,a.scroll.diff.value)},m={client:d,page:p};if("COLLECTING"===t.phase)return(0,jz.Z)({phase:"COLLECTING"},t,{dimensions:s,viewport:a,current:m});var f=s.draggables[t.critical.draggable.id],h=i||lW({pageOffset:p.offset,draggable:f,draggables:s.draggables,droppables:s.droppables,previousImpact:t.impact,viewport:a,afterCritical:t.afterCritical}),g=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,o=e.impact,i=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,o=eW(t),i=eW(n);if(!o)return r;if(o===i)return r;var l=r[o];if(!l.subject.withPlaceholder)return r;var a=function(e){var t=e.subject.withPlaceholder;t||zH(!1);var n=e.frame;if(!n){var r=sV({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,jz.Z)({},e,{subject:r})}var o=t.oldFrameMaxScroll;o||zH(!1);var i=JV(n,o),l=sV({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return(0,jz.Z)({},e,{subject:l,frame:i})}(l);return aW(r,a)}({previousImpact:e.previousImpact,impact:o,droppables:r}),l=eW(o);if(!l)return i;var a=r[l];if(xV(t,a))return i;if(a.subject.withPlaceholder)return i;var s=QV(a,t,n);return aW(i,s)}({draggable:f,impact:h,previousImpact:t.impact,draggables:s.draggables,droppables:s.droppables});return(0,jz.Z)({},t,{current:m,dimensions:{draggables:s.draggables,droppables:g},impact:h,viewport:a,scrollJumpRequest:l||null,forceShouldAnimate:!l&&null})},cW=function(e){var t=e.impact,n=e.viewport,r=e.draggables,o=e.destination,i=e.forceShouldAnimate,l=t.displaced,a=function(e,t){return e.map((function(e){return t[e]}))}(l.all,r),s=AV({afterDragging:a,destination:o,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:i,last:l});return(0,jz.Z)({},t,{displaced:s})},uW=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.viewport,l=e.afterCritical,a=HV({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:l});return $V({pageBorderBoxCenter:a,draggable:n,viewport:i})},dW=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&zH(!1);var o=t.impact,i=r||t.viewport,l=n||t.dimensions,a=l.draggables,s=l.droppables,c=a[t.critical.draggable.id],u=eW(o);u||zH(!1);var d=s[u],p=cW({impact:o,viewport:i,destination:d,draggables:a}),m=uW({impact:p,draggable:c,droppable:d,draggables:a,viewport:i,afterCritical:t.afterCritical});return sW({impact:p,clientSelection:m,state:t,dimensions:l,viewport:i})},pW=function(e){var t=e.draggable,n=e.home,r=e.draggables,o=e.viewport,i=XV(n.axis,t.displaceBy),l=bV(n.descriptor.id,r),a=l.indexOf(t);-1===a&&zH(!1);var s,c=l.slice(a+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),d={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:i,effected:u};return{impact:{displaced:AV({afterDragging:c,destination:n,displacedBy:i,last:null,viewport:o.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(s=t.descriptor,{index:s.index,droppableId:s.droppableId})}},afterCritical:d}},mW=function(e){return"SNAP"===e.movementMode},fW=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:aW(e.droppables,t)}}(e.dimensions,t);return!mW(e)||n?sW({state:e,dimensions:r}):dW({state:e,dimensions:r})};function hW(e){return e.isDragging&&"SNAP"===e.movementMode?(0,jz.Z)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var gW={phase:"IDLE",completed:null,shouldFlush:!1},vW=function(e,t){if(void 0===e&&(e=gW),"FLUSH"===t.type)return(0,jz.Z)({},gW,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&zH(!1);var n=t.payload,r=n.critical,o=n.clientSelection,i=n.viewport,l=n.dimensions,a=n.movementMode,s=l.draggables[r.draggable.id],c=l.droppables[r.droppable.id],u={selection:o,borderBoxCenter:s.client.borderBox.center,offset:YH},d={client:u,page:{selection:XH(u.selection,i.scroll.initial),borderBoxCenter:XH(u.selection,i.scroll.initial),offset:XH(u.selection,i.scroll.diff.value)}},p=gV(l.droppables).every((function(e){return!e.isFixedOnPage})),m=pW({draggable:s,home:c,draggables:l.draggables,viewport:i}),f=m.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:a,dimensions:l,initial:d,current:d,isWindowScrollAllowed:p,impact:f,afterCritical:m.afterCritical,onLiftImpact:f,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&zH(!1),(0,jz.Z)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&zH(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return cV(n,e.scroll)})),o=(0,jz.Z)({},t.dimensions.droppables,{},fV(r)),i=hV(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,o=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,i=function(e){var t=e.frame;return t||zH(!1),t}(n[t]),l=i.scroll.diff.value,a=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,o=LH(t.client,n),i=PH(o,r);return(0,jz.Z)({},t,{placeholder:(0,jz.Z)({},t.placeholder,{client:o}),client:o,page:i})}({draggable:e,offset:XH(o,l),initialWindowScroll:r.scroll.initial});return a}))}({additions:n.additions,updatedDroppables:o,viewport:t.viewport})),l=(0,jz.Z)({},t.dimensions.draggables,{},i);n.removals.forEach((function(e){delete l[e]}));var a={droppables:o,draggables:l},s=eW(t.impact),c=s?a.droppables[s]:null,u=a.draggables[t.critical.draggable.id],d=a.droppables[t.critical.droppable.id],p=pW({draggable:u,home:d,draggables:l,viewport:t.viewport}),m=p.impact,f=p.afterCritical,h=c&&c.isCombineEnabled?t.impact:m,g=lW({pageOffset:t.current.page.offset,draggable:a.draggables[t.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:h,viewport:t.viewport,afterCritical:f}),v=(0,jz.Z)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:g,onLiftImpact:m,dimensions:a,afterCritical:f,forceShouldAnimate:!1});return"COLLECTING"===t.phase?v:(0,jz.Z)({phase:"DROP_PENDING"},v,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;nW(e)||zH(!1);var h=t.payload.client;return QH(h,e.current.client.selection)?e:sW({state:e,clientSelection:h,impact:mW(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return hW(e);if("COLLECTING"===e.phase)return hW(e);nW(e)||zH(!1);var g=t.payload,v=g.id,b=g.newScroll,y=e.dimensions.droppables[v];if(!y)return e;var _=cV(y,b);return fW(e,_,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;nW(e)||zH(!1);var k=t.payload,x=k.id,w=k.isEnabled,C=e.dimensions.droppables[x];C||zH(!1),C.isEnabled===w&&zH(!1);var E=(0,jz.Z)({},C,{isEnabled:w});return fW(e,E,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;nW(e)||zH(!1);var S=t.payload,I=S.id,T=S.isCombineEnabled,N=e.dimensions.droppables[I];N||zH(!1),N.isCombineEnabled===T&&zH(!1);var B=(0,jz.Z)({},N,{isCombineEnabled:T});return fW(e,B,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;nW(e)||zH(!1),e.isWindowScrollAllowed||zH(!1);var L=t.payload.newScroll;if(QH(e.viewport.scroll.current,L))return hW(e);var P=VV(e.viewport,L);return mW(e)?dW({state:e,viewport:P}):sW({state:e,viewport:P})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!nW(e))return e;var A=t.payload.maxScroll;if(QH(A,e.viewport.scroll.max))return e;var D=(0,jz.Z)({},e.viewport,{scroll:(0,jz.Z)({},e.viewport.scroll,{max:A})});return(0,jz.Z)({phase:"DRAGGING"},e,{viewport:D})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&zH(!1);var R=tW({state:e,type:t.type});return R?sW({state:e,impact:R.impact,clientSelection:R.clientSelection,scrollJumpRequest:R.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var M=t.payload.reason;return"COLLECTING"!==e.phase&&zH(!1),(0,jz.Z)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:M})}if("DROP_ANIMATE"===t.type){var O=t.payload,Z=O.completed,F=O.dropDuration,j=O.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&zH(!1),{phase:"DROP_ANIMATING",completed:Z,dropDuration:F,newHomeClientOffset:j,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},bW=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},yW=function(){return{type:"COLLECTION_STARTING",payload:null}},_W=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},kW=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},xW=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},wW=function(e){return{type:"MOVE",payload:e}},CW=function(){return{type:"MOVE_UP",payload:null}},EW=function(){return{type:"MOVE_DOWN",payload:null}},SW=function(){return{type:"MOVE_RIGHT",payload:null}},IW=function(){return{type:"MOVE_LEFT",payload:null}},TW=function(e){return{type:"DROP_COMPLETE",payload:e}},NW=function(e){return{type:"DROP",payload:e}},BW="cubic-bezier(.2,1,.1,1)",LW=0,PW=.7,AW=.75,DW="0.2s cubic-bezier(0.2, 0, 0, 1)",RW={fluid:"opacity "+DW,snap:"transform "+DW+", opacity "+DW,drop:function(e){var t=e+"s "+BW;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+DW,placeholder:"height "+DW+", width "+DW+", margin "+DW},MW=function(e){return QH(e,YH)?null:"translate("+e.x+"px, "+e.y+"px)"},OW=MW,ZW=.33,FW=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var o=t(),i=r.payload.reason;if("COLLECTING"!==o.phase){if("IDLE"!==o.phase){"DROP_PENDING"===o.phase&&o.isWaiting&&zH(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&zH(!1);var l=o.critical,a=o.dimensions,s=a.draggables[o.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,o=e.home,i=e.viewport,l=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,jz.Z)({},r,{displaced:CV}),didDropInsideDroppable:!0}:{impact:cW({draggables:t,impact:l,destination:o,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=c.impact,d=c.didDropInsideDroppable,p=d?yV(u):null,m=d?_V(u):null,f={index:l.draggable.index,droppableId:l.droppable.id},h={draggableId:s.descriptor.id,type:s.descriptor.type,source:f,reason:i,mode:o.movementMode,destination:p,combine:m},g=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,o=e.viewport,i=e.afterCritical,l=r.draggables,a=r.droppables,s=eW(t),c=s?a[s]:null,u=a[n.descriptor.droppableId],d=uW({impact:t,draggable:n,draggables:l,afterCritical:i,droppable:c||u,viewport:o});return JH(d,n.client.borderBox.center)}({impact:u,draggable:s,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),v={critical:o.critical,afterCritical:o.afterCritical,result:h,impact:u};if(!QH(o.current.client.offset,g)||Boolean(h.combine)){var b=function(e){var t=e.reason,n=nV(e.current,e.destination);if(n<=0)return ZW;if(n>=1500)return.55;var r=ZW+n/1500*.22000000000000003;return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:o.current.client.offset,destination:g,reason:i});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:g,dropDuration:b,completed:v}})}else n(TW({completed:v}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:i}))}else e(r)}}},jW=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var zW=function(e){var t=function(e){var t=e.onWindowScroll,n=MH((function(){t(jW())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(n),o=ZH;function i(){return o!==ZH}return{start:function(){i()&&zH(!1),o=FH(window,[r])},stop:function(){i()||zH(!1),n.cancel(),o(),o=ZH},isActive:i}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},HW=function(e,t){t()},VW=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},WW=function(e,t,n,r){if(e){var o=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),o=function(o){t||n||(t=!0,e(o),clearTimeout(r))};return o.wasCalled=function(){return t},o}(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}else n(r(t))},$W=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=dV(n,(function(t){return t.timerId===e}));-1===t&&zH(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),o=null,i=function(n){o||zH(!1),o=null,HW(0,(function(){return WW(e().onDragEnd,n,t,KH)}))};return{beforeCapture:function(t,n){o&&zH(!1),HW(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){o&&zH(!1),HW(0,(function(){var r=e().onBeforeDragStart;r&&r(VW(t,n))}))},start:function(n,i){o&&zH(!1);var l=VW(n,i);o={mode:i,lastCritical:n,lastLocation:l.source,lastCombine:null},r.add((function(){HW(0,(function(){return WW(e().onDragStart,l,t,GH)}))}))},update:function(n,i){var l=yV(i),a=_V(i);o||zH(!1);var s=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,o.lastCritical);s&&(o.lastCritical=n);var c,u,d=(u=l,!(null==(c=o.lastLocation)&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(o.lastLocation=l);var p=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(o.lastCombine,a);if(p&&(o.lastCombine=a),s||d||p){var m=(0,jz.Z)({},VW(n,o.mode),{combine:a,destination:l});r.add((function(){HW(0,(function(){return WW(e().onDragUpdate,m,t,qH)}))}))}},flush:function(){o||zH(!1),r.flush()},drop:i,abort:function(){if(o){var e=(0,jz.Z)({},VW(o.lastCritical,o.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var o=r.payload.critical;return n.beforeStart(o,r.payload.movementMode),t(r),void n.start(o,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var i=r.payload.completed.result;return n.flush(),t(r),void n.drop(i)}if(t(r),"FLUSH"!==r.type){var l=e.getState();"DRAGGING"===l.phase&&n.update(l.critical,l.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},UW=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&zH(!1),e.dispatch(TW({completed:r.completed}))}else t(n)}}},GW=function(e){var t=null,n=null;return function(r){return function(o){if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),"DROP_ANIMATE"===o.type){var i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=FH(window,[i])}))}}}},qW=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(NW({reason:r.reason})))}}}},KW=zz.qC,YW=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,o=e.width,i=JH({x:n,y:t},{x:o,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},XW=function(){var e=document.documentElement;return e||zH(!1),e},JW=function(){var e=XW();return YW({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function QW(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var e$,t$,n$=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},o=null,i=function(){o||(n.collectionStarting(),o=requestAnimationFrame((function(){o=null;var e=r,i=e.additions,l=e.removals,a=e.modified,s=Object.keys(i).map((function(e){return t.draggable.getById(e).getDimension(YH)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(a).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:s,removals:Object.keys(l),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],i()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],i()},stop:function(){o&&(cancelAnimationFrame(o),o=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=function(t){n||zH(!1);var o=n.critical.draggable;"ADDITION"===t.type&&QW(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&QW(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:function(r,o){e.droppable.exists(r)||zH(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:function(r,o){n&&(e.droppable.exists(r)||zH(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,o){n&&(e.droppable.exists(r)||zH(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:function(t){n&&zH(!1);var r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),l={draggable:r.descriptor,droppable:i.descriptor},a=e.subscribe(o);return n={critical:l,unsubscribe:a},function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,o=function(){var e=jW(),t=JW(),n=e.y,r=e.x,o=XW(),i=o.clientWidth,l=o.clientHeight;return{frame:EH({top:n,left:r,right:r+i,bottom:n+l}),scroll:{initial:e,current:e,max:t,diff:{value:YH,displacement:YH}}}}(),i=o.scroll.current,l=t.droppable,a=r.droppable.getAllByType(l.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(i,n)})),s=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(i)}));return{dimensions:{draggables:hV(s),droppables:fV(a)},critical:t,viewport:o}}({critical:l,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return i},r$=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},o$=function(e){window.scrollBy(e.x,e.y)},i$=(0,RH.default)((function(e){return gV(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),l$=function(e){return Math.pow(e,2)},a$=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,o=n-t;return 0===o?0:(r-t)/o},s$=360,c$=1200,u$=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,o=e.shouldUseTimeDampening,i=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=a$({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*l$(1-n);return Math.ceil(r)}(t,n);return 0===i?0:o?Math.max(function(e,t){var n=t,r=c$,o=Date.now()-n;if(o>=c$)return e;if(ot.height,i=n.width>t.width;return i||o?i&&o?null:{x:i?0:r.x,y:o?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?QH(u,YH)?null:u:null},f$=oV((function(e){return 0===e?0:e>0?1:-1})),h$=(e$=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,o=XH(t,r),i={x:e$(o.x,n.x),y:e$(o.y,n.y)};return QH(i,YH)?null:i}),g$=function(e){var t=e.max,n=e.current,r=e.change,o={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},i=f$(r),l=h$({max:o,current:n,change:i});return!l||0!==i.x&&0===l.x||0!==i.y&&0===l.y},v$=function(e,t){return g$({current:e.scroll.current,max:e.scroll.max,change:t})},b$=function(e,t){var n=e.frame;return!!n&&g$({current:n.scroll.current,max:n.scroll.max,change:t})},y$=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,o=e.scrollWindow,i=e.scrollDroppable,l=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var s=function(e){var t=e.viewport,n=e.subject,r=e.center,o=e.shouldUseTimeDampening,i=m$({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return i&&v$(t,i)?i:null}({dragStartTime:n,viewport:t.viewport,subject:a,center:l,shouldUseTimeDampening:r});if(s)return void o(s)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var o=r[n];return o.frame?o:null}var i=function(e,t){var n=pV(i$(t),(function(t){return t.frame||zH(!1),rW(t.frame.pageMarginBox)(e)}));return n}(t,r);return i}({center:l,destination:eW(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,o=e.dragStartTime,i=e.shouldUseTimeDampening,l=t.frame;if(!l)return null;var a=m$({dragStartTime:o,container:l.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:i});return a&&b$(t,a)?a:null}({dragStartTime:n,droppable:c,subject:a,center:l,shouldUseTimeDampening:r});u&&i(c.descriptor.id,u)}},_$=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var o=e.scrollJumpRequest;if(o){var i=eW(e.impact);i||zH(!1);var l=function(e,t){if(!b$(e,t))return t;var r=function(e,t){var n=e.frame;return n&&b$(e,t)?h$({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var o=JH(t,r);return n(e.descriptor.id,o),JH(t,o)}(e.dimensions.droppables[i],o);if(l){var a=e.viewport,s=function(e,t,n){if(!e)return n;if(!v$(t,n))return n;var o=function(e,t){if(!v$(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return h$({current:r,max:n,change:t})}(t,n);if(!o)return r(n),null;var i=JH(n,o);return r(i),JH(n,i)}(e.isWindowScrollAllowed,a,l);s&&function(e,n){var r=XH(e.current.client.selection,n);t({client:r})}(e,s)}}}},k$={base:t$="data-rbd-drag-handle",draggableId:t$+"-draggable-id",contextId:t$+"-context-id"},x$=function(){var e="data-rbd-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),w$=function(){var e="data-rbd-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),C$="data-rbd-scroll-container-context-id",E$=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},S$="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?v.useLayoutEffect:v.useEffect,I$=function(){var e=document.querySelector("head");return e||zH(!1),e},T$=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};var N$=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function B$(e){return e instanceof N$(e).HTMLElement}function L$(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}var o={register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||zH(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return uV(e.draggables).filter((function(e){return e.descriptor.type===t}))}};function i(t){return e.droppables[t]||null}var l={register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||zH(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return uV(e.droppables).filter((function(e){return e.descriptor.type===t}))}};return{draggable:o,droppable:l,subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var P$=v.createContext(null),A$=function(){var e=document.body;return e||zH(!1),e},D$={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},R$=0,M$={separator:"::"};function O$(e,t){return void 0===t&&(t=M$),(0,_I.Ye)((function(){return""+e+t.separator+R$++}),[t.separator,e])}var Z$=v.createContext(null);function F$(e){var t=(0,v.useRef)(e);return(0,v.useEffect)((function(){t.current=e})),t}var j$,z$,H$=((j$={})[13]=!0,j$[9]=!0,j$),V$=function(e){H$[e.keyCode]&&e.preventDefault()},W$=function(){var e="visibilitychange";return"undefined"==typeof document?e:pV([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),$$={type:"IDLE"};function U$(){}var G$=((z$={})[34]=!0,z$[33]=!0,z$[36]=!0,z$[35]=!0,z$);var q$={type:"IDLE"},K$={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Y$(e,t){if(null==t)return!1;if(Boolean(K$[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&Y$(e,t.parentElement)}function X$(e,t){var n=t.target;return!!B$(n)&&Y$(e,n)}var J$=function(e){return EH(e.getBoundingClientRect()).center},Q$=function(){var e="matches";return"undefined"==typeof document?e:pV([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function eU(e,t){return null==e?null:e[Q$](t)?e:eU(e.parentElement,t)}function tU(e,t){return e.closest?e.closest(t):eU(e,t)}function nU(e){e.preventDefault()}function rU(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function oU(e){var t=e.lockAPI,n=e.store,r=e.registry,o=e.draggableId;if(t.isClaimed())return!1;var i=r.draggable.findById(o);return!!i&&!!i.options.isEnabled&&!!r$(n.getState(),o)}var iU=[function(e){var t=(0,v.useRef)($$),n=(0,v.useRef)(ZH),r=(0,_I.Ye)((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,l,{sourceEvent:t});if(o){t.preventDefault();var i={x:t.clientX,y:t.clientY};n.current(),c(o,i)}}}}}}),[e]),o=(0,_I.Ye)((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),i=(0,_I.I4)((function(){n.current=FH(window,[o,r],{passive:!1,capture:!0})}),[o,r]),l=(0,_I.I4)((function(){"IDLE"!==t.current.type&&(t.current=$$,n.current(),i())}),[i]),a=(0,_I.I4)((function(){var e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),s=(0,_I.I4)((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,o=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,i=e.clientY;if(0===t){var l={x:n,y:i},a=r();if("DRAGGING"===a.type)return e.preventDefault(),void a.actions.move(l);if("PENDING"!==a.type&&zH(!1),s=a.point,c=l,Math.abs(c.x-s.x)>=5||Math.abs(c.y-s.y)>=5){var s,c;e.preventDefault();var u=a.actions.fluidLift(l);o({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void V$(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&zH(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:W$,fn:t}]}({cancel:a,completed:l,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=FH(window,e,{capture:!0,passive:!1})}),[a,l]),c=(0,_I.I4)((function(e,n){"IDLE"!==t.current.type&&zH(!1),t.current={type:"PENDING",point:n,actions:e},s()}),[s]);S$((function(){return i(),function(){n.current()}}),[i])},function(e){var t=(0,v.useRef)(U$),n=(0,_I.Ye)((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var o=e.findClosestDraggableId(n);if(o){var i=e.tryGetLock(o,s,{sourceEvent:n});if(i){n.preventDefault();var l=!0,a=i.snapLift();t.current(),t.current=FH(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(G$[r.keyCode]?r.preventDefault():V$(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:W$,fn:n}]}(a,s),{capture:!0,passive:!1})}}}function s(){l||zH(!1),l=!1,t.current(),r()}}}}),[e]),r=(0,_I.I4)((function(){t.current=FH(window,[n],{passive:!1,capture:!0})}),[n]);S$((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,v.useRef)(q$),n=(0,v.useRef)(ZH),r=(0,_I.I4)((function(){return t.current}),[]),o=(0,_I.I4)((function(e){t.current=e}),[]),i=(0,_I.Ye)((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,a,{sourceEvent:t});if(o){var i=t.touches[0],l={x:i.clientX,y:i.clientY};n.current(),d(o,l)}}}}}}),[e]),l=(0,_I.I4)((function(){n.current=FH(window,[i],{capture:!0,passive:!1})}),[i]),a=(0,_I.I4)((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(q$),n.current(),l())}),[l,o]),s=(0,_I.I4)((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),c=(0,_I.I4)((function(){var e={capture:!0,passive:!1},t={cancel:s,completed:a,getPhase:r},o=FH(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var o=e.touches[0],i={x:o.clientX,y:o.clientY};e.preventDefault(),n.actions.move(i)}else t()}},{eventName:"touchend",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&zH(!1);var o=e.touches[0];if(o&&o.force>=.15){var i=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return i?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();i&&t()}}},{eventName:W$,fn:t}]}(t),e),i=FH(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:W$,fn:t}]}(t),e);n.current=function(){o(),i()}}),[s,r,a]),u=(0,_I.I4)((function(){var e=r();"PENDING"!==e.type&&zH(!1);var t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,o]),d=(0,_I.I4)((function(e,t){"IDLE"!==r().type&&zH(!1);var n=setTimeout(u,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,o,u]);S$((function(){return l(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(q$))}}),[r,l,o]),S$((function(){return FH(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function lU(e){var t=e.contextId,n=e.store,r=e.registry,o=e.customSensors,i=e.enableDefaultSensors,l=[].concat(i?iU:[],o||[]),a=(0,v.useState)((function(){return function(){var e=null;function t(){e||zH(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&zH(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],s=(0,_I.I4)((function(e,t){e.isDragging&&!t.isDragging&&a.tryAbandon()}),[a]);S$((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();s(e,t),e=t}))}),[a,n,s]),S$((function(){return a.tryAbandon}),[a.tryAbandon]);for(var c=(0,_I.I4)((function(e){return oU({lockAPI:a,registry:r,store:n,draggableId:e})}),[a,r,n]),u=(0,_I.I4)((function(e,o,i){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,o=e.registry,i=e.draggableId,l=e.forceSensorStop,a=e.sourceEvent;if(!oU({lockAPI:t,store:r,registry:o,draggableId:i}))return null;var s=o.draggable.getById(i),c=function(e,t){var n="["+x$.contextId+'="'+e+'"]',r=pV(mV(document.querySelectorAll(n)),(function(e){return e.getAttribute(x$.id)===t}));return r&&B$(r)?r:null}(n,s.descriptor.id);if(!c)return null;if(a&&!s.options.canDragInteractiveElements&&X$(c,a))return null;var u=t.claim(l||ZH),d="PRE_DRAG";function p(){return s.options.shouldRespectForcePress}function m(){return t.isActive(u)}var f=function(e,t){rU({expected:e,phase:d,isLockActive:m,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function h(e){function n(){t.release(),d="COMPLETED"}function o(t,o){if(void 0===o&&(o={shouldBlockNextClick:!1}),e.cleanup(),o.shouldBlockNextClick){var i=FH(window,[{eventName:"click",fn:nU,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(i)}n(),r.dispatch(NW({reason:t}))}return"PRE_DRAG"!==d&&(n(),"PRE_DRAG"!==d&&zH(!1)),r.dispatch(function(e){return{type:"LIFT",payload:e}}(e.liftActionArgs)),d="DRAGGING",(0,jz.Z)({isActive:function(){return rU({expected:"DRAGGING",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(e){return o("DROP",e)},cancel:function(e){return o("CANCEL",e)}},e.actions)}var g={isActive:function(){return rU({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=MH((function(e){f((function(){return wW({client:e})}))})),n=h({liftActionArgs:{id:i,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,jz.Z)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return f(CW)},moveRight:function(){return f(SW)},moveDown:function(){return f(EW)},moveLeft:function(){return f(IW)}};return h({liftActionArgs:{id:i,clientSelection:J$(c),movementMode:"SNAP"},cleanup:ZH,actions:e})},abort:function(){rU({expected:"PRE_DRAG",phase:d,isLockActive:m,shouldWarn:!0})&&t.release()}};return g}({lockAPI:a,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})}),[t,a,r,n]),d=(0,_I.I4)((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof N$(n).Element))return null;var o=function(e){return"["+k$.contextId+'="'+e+'"]'}(e),i=tU(r,o);return i&&B$(i)?i:null}(e,t);return n?n.getAttribute(k$.draggableId):null}(t,e)}),[t]),p=(0,_I.I4)((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),m=(0,_I.I4)((function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch({type:"FLUSH",payload:null}))}),[a,n]),f=(0,_I.I4)(a.isClaimed,[a]),h=(0,_I.Ye)((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:m,isLockClaimed:f}}),[c,u,d,p,m,f]),g=0;go(t.id,e.target.checked)},`check-${t.id}`),(0,zF.jsx)("input",{type:"text",value:t.name,"data-automation-id":"custom_field_value_settings_value",onChange:e=>r(t.id,e.target.value)}),0!==i&&(0,zF.jsx)(Zz.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,U.partial)(n,t.id)})]},t.id)}function WU(e){let{values:t,update:n,remove:r,onReorder:o}=e;const[i,l]=(0,v.useState)(t);if((0,v.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.name=t,n(r)},s=(e,t)=>{const r=i.find((t=>t.id===e));if(t){const e=i.find((e=>e.isChecked));e&&(delete e.isChecked,n(e)),r.isChecked=!0}else delete r.isChecked;n(r)};return(0,zF.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,zF.jsx)(uU,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,zF.jsx)(HU,{droppableId:"droppable",children:e=>(0,zF.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,zF.jsx)(ZU,{draggableId:e.id,index:t,children:n=>(0,zF.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,zF.jsx)(VU,{index:t,value:e,remove:r,onCheck:s,onUpdate:a},`inner${e.id}`)})},e.id))),e.placeholder]})})})})}function $U(e){let{label:t,mandatory:n,values:r,isSaving:o,onSave:i,isDeleting:l,onCustomFieldDelete:a,onChange:s,useDragAndDrop:c}=e;const[u,d]=(0,v.useState)(t),[p,m]=(0,v.useState)(n),[f,h]=(0,v.useState)(JSON.parse(JSON.stringify(r))),g=(0,v.useMemo)((()=>({label:u,mandatory:p,values:f,isValid:(0,U.reduce)(f,((e,t)=>!(0,U.isEmpty)(t.name)&&e),!0)})),[u,p,f]),b=p!==n||!(0,U.isEqualWith)(r,f)||u!==t;return(0,v.useEffect)((()=>{s&&s(g,b)}),[g,s,b]),(0,zF.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,zF.jsx)(WU,{remove:e=>{h(f.filter((t=>e!==t.id)))},update:e=>{h(f.map((t=>e.id!==t.id?t:e)))},values:f,onReorder:h,useDragAndDrop:c}),(0,zF.jsx)(Mo.ZP,{isLink:!0,onClick:()=>h([...f,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${f.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:OF.x.I18n.t("customFieldAddItem")}),(0,zF.jsx)("br",{}),i?(0,zF.jsx)(Mo.ZP,{isPrimary:!0,onClick:()=>i({mandatory:p,values:f,label:u}),isBusy:o,disabled:o||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:OF.x.I18n.t("customFieldSaveCTA")}):null,a?(0,zF.jsx)(iz,{isBusy:o||l,onDelete:a}):null]})}function UU(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),i=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,S.Z)(WF),c=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)($U,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:o,onSave:e=>l({customFieldId:t.customFieldId,data:{params:mz("radio",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});return(0,zF.jsxs)(pz,{className:t.className,children:[c,(0,zF.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:t.hideLabel?null:az(t)}),Array.isArray(t.values)&&t.values.map((e=>(0,zF.jsx)("div",{children:(0,zF.jsxs)("label",{children:[(0,zF.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id)))]})}function GU(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}let qU,KU;HU.defaultProps=zU,VU.propTypes={value:jF().shape({name:jF().string.isRequired,id:jF().string.isRequired,isChecked:jF().bool}).isRequired,onUpdate:jF().func.isRequired,onCheck:jF().func.isRequired,index:jF().number.isRequired,remove:jF().func.isRequired},WU.propTypes={values:jF().arrayOf(jF().shape({name:jF().string.isRequired,id:jF().string.isRequired}).isRequired).isRequired,update:jF().func.isRequired,remove:jF().func.isRequired,onReorder:jF().func.isRequired},$U.propTypes={label:jF().string,mandatory:jF().bool,values:jF().arrayOf(jF().shape({name:jF().string.isRequired,id:jF().string.isRequired})),onSave:jF().func,isSaving:jF().bool,isDeleting:jF().bool,onCustomFieldDelete:jF().func,onChange:jF().func,useDragAndDrop:jF().bool},$U.defaultProps={label:"",mandatory:!1,isSaving:!1,values:[],isDeleting:!1,onCustomFieldDelete:null,onSave:null,onChange:null,useDragAndDrop:!0},UU.propTypes={attributes:jF().shape({label:jF().string.isRequired,customFieldId:jF().number.isRequired,values:jF().arrayOf(jF().shape({name:jF().string.isRequired,id:jF().string.isRequired,isChecked:jF().bool})),mandatory:jF().bool.isRequired,hideLabel:jF().bool,className:jF().string}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired},function(e){e.Divider="divider",e.Spacer="spacer"}(qU||(qU={})),function(e){e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted"}(KU||(KU={}));const YU={className:void 0,height:1,type:qU.Divider,style:KU.Solid,dividerHeight:1,dividerWidth:100,color:"black"},XU=()=>`${Math.random().toString()}-${Date.now()}`,JU=e=>e.map((e=>{const t={name:e.value,id:XU()};return(0,U.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t})),QU=(e,t,n)=>{const r=t.find((t=>t.id===parseInt(e.id,10)));if(!r)return null;const o={...n,name:ez({text:"mailpoet-form/custom-text",textarea:"mailpoet-form/custom-textarea",radio:"mailpoet-form/custom-radio",checkbox:"mailpoet-form/custom-checkbox",select:"mailpoet-form/custom-select",date:"mailpoet-form/custom-date"}[r.type],r)};return o.attributes.customFieldId=r.id,e.params&&((0,U.has)(e.params,"validate")&&e.params.validate&&(o.attributes.validate=e.params.validate),(0,U.has)(e.params,"hide_label")&&(o.attributes.hideLabel=!!e.params.hide_label),(0,U.has)(e.params,"lines")&&(o.attributes.lines=e.params.lines),(0,U.has)(e.params,"date_type")&&(o.attributes.dateType=e.params.date_type),(0,U.has)(e.params,"date_format")&&(o.attributes.dateFormat=e.params.date_format),(0,U.has)(e.params,"is_default_today")&&(o.attributes.defaultToday=!!e.params.is_default_today),(0,U.has)(e.params,"values")&&Array.isArray(e.params.values)&&(o.attributes.values=JU(e.params.values))),"text"!==r.type&&"textarea"!==r.type||(o.attributes.styles=bz(e.styles)),o},eG=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const i=tG(t,n,r,o),l={clientId:XU(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:i(e.body?e.body:[])},a=yz(n,e.params.text_color),s=yz(n,e.params.background_color),c=_z(r,e.params.gradient);return(0,U.has)(e.params,"width")&&(l.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,U.has)(e.params,"vertical_alignment")&&(l.attributes.verticalAlignment=e.params.vertical_alignment),(0,U.has)(e.params,"text_color")&&(l.attributes.textColor=a,l.attributes.style.color.text=a?void 0:e.params.text_color),(0,U.has)(e.params,"background_color")&&(l.attributes.backgroundColor=s,l.attributes.style.color.background=s?void 0:e.params.background_color),(0,U.has)(e.params,"gradient")&&(l.attributes.gradient=c,l.attributes.style.color.gradient=c?void 0:e.params.gradient),(0,U.has)(e.params,"class_name")&&e.params.class_name&&(l.attributes.className=e.params.class_name),(0,U.has)(e.params,"padding")&&(l.attributes.style.spacing={padding:e.params.padding}),(0,U.has)(e.params,"is_stacked_on_mobile")&&(l.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,U.has)(e.params,"is_stacked_on_mobile")||(l.attributes.isStackedOnMobile=!0),l},tG=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=o=>{if(!Array.isArray(o))throw new Error("Mapper expects form body to be an array.");return o.map((o=>{var i,l,a,s,c,u,d,p,m,f,h,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,L,P,A,D;if(["column","columns"].includes(o.type))return eG(o,e,t,n,r);const R={clientId:`${o.id}_${XU()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(o.type)&&(R.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),o.params&&(0,U.has)(o.params,"class_name")&&(R.attributes.className=o.params.class_name),o.params&&(0,U.has)(o.params,"required")&&(R.attributes.mandatory=!!o.params.required),o.params&&(0,U.has)(o.params,"label_within")&&(R.attributes.labelWithinInput=!!o.params.label_within),o.params&&(R.attributes.label=o.params.label?o.params.label:""),o.params&&(0,U.has)(o.params,"text_color")){const e=yz(t,o.params.text_color);R.attributes.textColor=e,["heading","paragraph"].includes(o.type)&&!e?R.attributes.style.color.text=o.params.text_color:e||(R.attributes.customTextColor=o.params.text_color)}if(o.params&&(0,U.has)(o.params,"background_color")){const e=yz(t,o.params.background_color);R.attributes.backgroundColor=e,["heading","paragraph"].includes(o.type)&&!e?R.attributes.style.color.background=o.params.background_color:e||(R.attributes.customBackgroundColor=o.params.background_color)}if(o.params&&(0,U.has)(o.params,"font_size")){const t=`${o.params.font_size}${Number.isNaN(Number(`${o.params.font_size}`||NaN))?"":"px"}`,n=kz(e,t);R.attributes.fontSize=n,R.attributes.style.typography.fontSize=n?void 0:t}o.params&&(0,U.has)(o.params,"line_height")&&(R.attributes.style.typography.lineHeight=o.params.line_height);let M=2;switch(o.id){case"email":return{...R,name:"mailpoet-form/email-input",attributes:{...R.attributes,styles:bz(o.styles)}};case"heading":return o.params&&(0,U.has)(o.params,"level")&&(M=GU(o.params.level),void 0===M&&(M=2)),{...R,attributes:{...R.attributes,content:(null===(i=o.params)||void 0===i?void 0:i.content)||"",level:M,textAlign:null===(l=o.params)||void 0===l?void 0:l.align,anchor:null===(a=o.params)||void 0===a?void 0:a.anchor,className:null===(s=o.params)||void 0===s?void 0:s.class_name},name:"core/heading"};case"paragraph":return{...R,attributes:{...R.attributes,content:(null===(c=o.params)||void 0===c?void 0:c.content)||"",align:null===(u=o.params)||void 0===u?void 0:u.align,className:null===(d=o.params)||void 0===d?void 0:d.class_name,dropCap:"1"===(null===(p=o.params)||void 0===p?void 0:p.drop_cap)},name:"core/paragraph"};case"image":return{...R,name:"core/image",attributes:{className:(null===(m=o.params)||void 0===m?void 0:m.class_name)||"",align:null===(f=o.params)||void 0===f?void 0:f.align,url:null===(h=o.params)||void 0===h?void 0:h.url,alt:null===(g=o.params)||void 0===g?void 0:g.alt,title:null===(v=o.params)||void 0===v?void 0:v.title,caption:null===(b=o.params)||void 0===b?void 0:b.caption,linkDestination:null===(y=o.params)||void 0===y?void 0:y.link_destination,link:null===(_=o.params)||void 0===_?void 0:_.link,href:null===(k=o.params)||void 0===k?void 0:k.href,linkClass:null===(x=o.params)||void 0===x?void 0:x.link_class,rel:null===(w=o.params)||void 0===w?void 0:w.rel,linkTarget:null===(C=o.params)||void 0===C?void 0:C.link_target,id:null===(E=o.params)||void 0===E?void 0:E.id,sizeSlug:null===(S=o.params)||void 0===S?void 0:S.size_slug,width:null===(I=o.params)||void 0===I?void 0:I.width,height:null===(T=o.params)||void 0===T?void 0:T.height}};case"first_name":return{...R,name:"mailpoet-form/first-name-input",attributes:{...R.attributes,styles:bz(o.styles)}};case"last_name":return{...R,name:"mailpoet-form/last-name-input",attributes:{...R.attributes,styles:bz(o.styles)}};case"segments":return o.params&&(0,U.has)(o.params,"values")&&Array.isArray(o.params.values)?R.attributes.values=o.params.values.map((e=>({id:e.id,isChecked:"1"===e.is_checked||void 0}))):R.attributes.values=[],{...R,name:"mailpoet-form/segment-select"};case"submit":return{...R,name:"mailpoet-form/submit-button",attributes:{...R.attributes,styles:bz(o.styles)}};case"divider":return delete R.attributes.label,{...R,name:"mailpoet-form/divider",attributes:{className:R.attributes.className,height:GU((null===(N=o.params)||void 0===N?void 0:N.height)??YU.height),type:(null===(B=o.params)||void 0===B?void 0:B.type)??YU.type,style:(null===(L=o.params)||void 0===L?void 0:L.style)??YU.style,dividerHeight:GU((null===(P=o.params)||void 0===P?void 0:P.divider_height)??YU.dividerHeight),dividerWidth:GU((null===(A=o.params)||void 0===A?void 0:A.divider_width)??YU.dividerWidth),color:(null===(D=o.params)||void 0===D?void 0:D.color)??YU.color}};case"html":return{...R,name:"mailpoet-form/html",attributes:{className:R.attributes.className,content:o.params&&o.params.text?o.params.text:"",nl2br:!(!o.params||!o.params.nl2br||!o.params.nl2br)}};default:return Number.isInteger(parseInt(o.id,10))?QU(o,r,R):null}})).filter(Boolean)};return o};function nG(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?JU(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:UU,save:()=>null}}function rG(e){let{label:t,mandatory:n,isSaving:r,onSave:o,isChecked:i,checkboxLabel:l,isDeleting:a,onCustomFieldDelete:s,onChange:c}=e;const[u,d]=(0,v.useState)(t),[p,m]=(0,v.useState)(n),[f,h]=(0,v.useState)(i),[g,b]=(0,v.useState)(l),y=p!==n||f!==i||u!==t||g!==l,_=(0,v.useMemo)((()=>({mandatory:p,isChecked:f,label:u,checkboxLabel:g,isValid:!(0,U.isEmpty)(g)})),[u,p,f,g]);return(0,v.useEffect)((()=>{c(_,y)}),[_,c,y]),(0,zF.jsxs)("div",{className:"custom-field-settings",children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:u,"data-automation-id":"settings_custom_text_label_input",onChange:d}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:p,onChange:m}),(0,zF.jsxs)(Xu.ZP,{children:[(0,zF.jsx)("input",{type:"checkbox",checked:f,onChange:e=>h(!!e.target.checked)}),(0,zF.jsx)("input",{value:g,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>b(e.target.value)})]}),o?(0,zF.jsx)(Mo.ZP,{isPrimary:!0,onClick:()=>o(_),isBusy:r,disabled:r||!y,className:"button-on-top","data-automation-id":"custom_field_save",children:OF.x.I18n.t("customFieldSaveCTA")}):null,s?(0,zF.jsx)(iz,{isBusy:r||a,onDelete:s}):null]})}function oG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),i=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),{saveCustomField:l,deleteCustomField:a,customFieldEdited:s}=(0,S.Z)(WF),c=()=>{if(Array.isArray(t.values)){const e=t.values[0];if(e)return e.name}return""},u=()=>{let e=!1;if(Array.isArray(t.values)){const n=t.values[0];n&&n.isChecked&&(e=!0)}return e},d=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)(rG,{label:t.label,mandatory:t.mandatory,isSaving:o,isChecked:u(),checkboxLabel:c(),onSave:e=>l({customFieldId:t.customFieldId,data:{params:mz("checkbox",e)},onFinish:()=>n({mandatory:e.mandatory,label:e.label,values:[{isChecked:e.isChecked,name:e.checkboxLabel}]})}),onCustomFieldDelete:()=>a(t.customFieldId,r),isDeleting:i,onChange:(e,t)=>t&&s()})})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabel"),checked:!t.hideLabel,onChange:e=>n({hideLabel:!e})})})})]});let p=c();return t.mandatory&&(p+=" *"),(0,zF.jsxs)(pz,{className:t.className,children:[d,(0,zF.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:t.hideLabel||!t.label?null:t.label}),(0,zF.jsx)("div",{children:(0,zF.jsxs)("label",{children:[(0,zF.jsx)("input",{type:"checkbox",disabled:!0,checked:u(),className:"mailpoet_checkbox"}),(0,zF.jsx)("span",{dangerouslySetInnerHTML:{__html:p}})]})})]})}function iG(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?JU(e.params.values):[]},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:oG,save:()=>null}}function lG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=(0,E.Z)((e=>e(WF).getFormSettings()),[]),i=(0,E.Z)((e=>e(WF).getIsCustomFieldSaving()),[]),l=(0,E.Z)((e=>e(WF).getIsCustomFieldDeleting()),[]),{saveCustomField:a,deleteCustomField:s,customFieldEdited:c}=(0,S.Z)(WF),u=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,zF.jsx)($U,{label:t.label,mandatory:t.mandatory,values:t.values,isSaving:i,onSave:e=>a({customFieldId:t.customFieldId,data:{params:mz("select",e)},onFinish:()=>n({mandatory:e.mandatory,values:e.values,label:e.label})}),onCustomFieldDelete:()=>s(t.customFieldId,r),isDeleting:l,onChange:(e,t)=>t&&c()})})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})})})]});return(0,zF.jsxs)(pz,{className:t.className,children:[u,(0,zF.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[t.labelWithinInput?null:(0,zF.jsx)("label",{className:"mailpoet_select_label",htmlFor:r,children:az(t)}),(()=>{let e=t.labelWithinInput?az(t):"-";const n=[{label:e}];!Array.isArray(t.values)&&t.values.length||t.values.forEach((r=>{n.push({label:r.name}),!t.labelWithinInput&&r.isChecked&&(e=r.name)}));const i={};return void 0!==o.inputPadding&&(i.padding=o.inputPadding),void 0!==o.alignment&&(i.textAlign=o.alignment,i.margin=Pz(i.textAlign)),o.fontFamily&&(i.fontFamily=o.fontFamily),(0,zF.jsx)("select",{style:i,className:"mailpoet_select",id:r,value:e,readOnly:!0,children:n.map(((e,t)=>(0,zF.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label)))})})()]})]})}function aG(e){return{title:e.name,description:"",icon:tz,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?JU(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:lG,save:()=>null}}function sG(e){return{date:{name:"mailpoet-form/custom-date",settings:hz(e)},text:{name:"mailpoet-form/custom-text",settings:Rz(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:Oz(e)},radio:{name:"mailpoet-form/custom-radio",settings:nG(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:iG(e)},select:{name:"mailpoet-form/custom-select",settings:aG(e)}}}rG.propTypes={label:jF().string,mandatory:jF().bool,onSave:jF().func,isSaving:jF().bool,isChecked:jF().bool,checkboxLabel:jF().string,isDeleting:jF().bool,onCustomFieldDelete:jF().func,onChange:jF().func},rG.defaultProps={label:"",mandatory:!1,onSave:null,isSaving:!1,isChecked:!1,checkboxLabel:"",isDeleting:!1,onCustomFieldDelete:null,onChange:()=>{}},oG.propTypes={attributes:jF().shape({label:jF().string.isRequired,customFieldId:jF().number.isRequired,mandatory:jF().bool.isRequired,hideLabel:jF().bool,className:jF().string,values:jF().arrayOf(jF().shape({name:jF().string.isRequired,isChecked:jF().bool}))}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired},lG.propTypes={attributes:jF().shape({customFieldId:jF().number.isRequired,labelWithinInput:jF().bool.isRequired,label:jF().string.isRequired,values:jF().arrayOf(jF().shape({name:jF().string.isRequired,isChecked:jF().bool,id:jF().string.isRequired})),mandatory:jF().bool.isRequired,className:jF().string}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired};const cG=(0,zF.jsxs)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,zF.jsx)(tp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,zF.jsx)(tp.y$,{d:"M19 13H5v-2h14v2z"})]}),uG={title:OF.x.I18n.t("blockDivider"),description:null,icon:cG,category:"design",attributes:{height:{type:"number",default:YU.height},type:{type:"string",default:YU.type},style:{type:"string",default:YU.style},dividerHeight:{type:"number",default:YU.dividerHeight},dividerWidth:{type:"number",default:YU.dividerWidth},color:{type:"string",default:YU.color}},supports:{html:!1,multiple:!0},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=t.dividerHeight??YU.dividerHeight,o=t.dividerWidth??YU.dividerWidth,i=t.height??YU.height,l=(0,zF.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:t.style,onChange:e=>n({style:e}),options:[{value:KU.Solid,label:OF.x.I18n.t("blockDividerStyleSolid")},{value:KU.Dashed,label:OF.x.I18n.t("blockDividerStyleDashed")},{value:KU.Dotted,label:OF.x.I18n.t("blockDividerStyleDotted")}]}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:r,min:1,max:40,allowReset:!0,onChange:e=>{let t=i;void 0!==e&&(t=Math.max(e,i)),n({dividerHeight:e,height:t})}}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:o,min:1,max:100,allowReset:!0,onChange:e=>n({dividerWidth:e})}),(0,zF.jsx)(Tz,{title:OF.x.I18n.t("formSettingsColor"),settings:[{label:OF.x.I18n.t("blockDividerBackground"),colorValue:t.color,onColorChange:e=>n({color:e})}]})]}),a={};return t.type===qU.Divider&&(a.borderTopStyle=t.style,a.borderTopWidth=r,a.borderTopColor=t.color,a.height=r,a.width=`${o}%`),(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(nh,{children:(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,zF.jsx)(iN,{label:OF.x.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:i,min:1,max:400,allowReset:!0,onChange:e=>{let t=r;t=void 0!==e?Math.min(e,r):1,n({height:e,dividerHeight:t})}}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:t.type===qU.Divider,onChange:e=>n({type:e?qU.Divider:qU.Spacer})}),t.type===qU.Divider&&l]})})}),(0,zF.jsx)("div",{className:w()("mailpoet_spacer",t.className),"data-automation-id":"editor_spacer_block",style:{height:i,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,zF.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:a})})]})},save:()=>null};function dG(e){let{attributes:t,setAttributes:n}=e;const r=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_email_label_input",onChange:e=>n({label:e})}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})})]})}),(0,zF.jsx)(Nz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,zF.jsxs)(zF.Fragment,{children:[r,(0,zF.jsx)(Az,{className:t.className,name:"email",label:t.label,labelWithinInput:!!t.labelWithinInput,mandatory:!0,styles:t.styles})]})}dG.propTypes={attributes:jF().shape({label:jF().string.isRequired,labelWithinInput:jF().bool.isRequired,className:jF().string,styles:Bz.isRequired}).isRequired,setAttributes:jF().func.isRequired};const pG=(0,zF.jsxs)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,zF.jsx)(tp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{fill:"#32373C",d:"m18.82592,6.5l-14,0c-0.8,0 -1.5,0.7 -1.5,1.5l0,8c0,0.8 0.7,1.5 1.5,1.5l14,0c0.8,0 1.5,-0.7 1.5,-1.5l0,-8c0,-0.8 -0.7,-1.5 -1.5,-1.5zm-1.2,1l-5.8,4.9l-5.8,-4.9l11.6,0zm1.7,8.5c0,0.3 -0.2,0.5 -0.5,0.5l-14,0c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-8c0,-0.2 0.1,-0.4 0.3,-0.4l6.9,5.9c0.1,0.1 0.2,0.1 0.3,0.1s0.2,0 0.3,-0.1l6.9,-5.9c0.2,0.1 0.3,0.2 0.3,0.4l0,8z"})})]}),mG={title:OF.x.I18n.t("blockEmail"),description:OF.x.I18n.t("blockEmailDescription"),icon:pG,category:"obligatory",attributes:{label:{type:"string",default:OF.x.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:gz}},supports:{html:!1,inserter:!1,multiple:!1},edit:dG,save:()=>null};function fG(e){let{value:t,onChange:n}=e;const r=bp("typography.fontSizes");return(0,zF.jsx)(fP,{value:t,onChange:n,fontSizes:r})}const hG=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function gG(e){let{onChange:t,value:n,name:r,hideLabelFromVision:o=!1}=e;const i=(0,E.Z)((e=>e(WF).getAllCustomFonts()),[]),l={color:"lightgray",backgroundColor:"white",cursor:"default"},a=e=>({fontFamily:e,cursor:"default",marginLeft:16}),s=[{key:OF.x.I18n.t("formFontsDefaultTheme"),name:OF.x.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:OF.x.I18n.t("formFontsStandard"),name:OF.x.I18n.t("formFontsStandard"),selectable:!1,style:l},...hG.map((e=>({key:e,name:e,selectable:!0,style:a(e),value:e})))];OF.x.libs3rdPartyEnabled&&(s.push({key:OF.x.I18n.t("formFontsCustom"),name:OF.x.I18n.t("formFontsCustom"),selectable:!1,style:l}),i.forEach((e=>{s.push({key:e,name:e,selectable:!0,style:a(e),value:e})})));let c=void 0!==n&&s.find((e=>e.value===n));return c||(c=s[0]),(0,zF.jsx)(HS,{__nextUnconstrainedWidth:!0,options:s,onChange:e=>{const n=e.selectedItem;n.selectable&&t(n.value)},value:c,label:r,className:"mailpoet-font-family-select",hideLabelFromVision:o})}function vG(){const e=(0,E.Z)((e=>e(WF).getAllCustomFonts()),[]);if(!OF.x.libs3rdPartyEnabled)return null;const t=e.map((e=>e.replace(" ","+"))).map((e=>e.concat(":400,400i,700,700i"))).join("|");return(0,zF.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function bG(e){let{styles:t,onChange:n,formInputPadding:r,formFontFamily:o}=e;const i=(0,v.useRef)(t),l=i.current,a=(e,t)=>{const r={...i.current};r[e]=t,n(r),i.current=r};return(0,zF.jsx)(oz.Z,{className:"mailpoet-automation-input-styles-panel",children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,zF.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsDisplayFullWidth"),checked:l.fullWidth,onChange:(0,U.partial)(a,"fullWidth")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsInheritStyleFromTheme"),checked:l.inheritFromTheme,onChange:e=>{if(e)return void a("inheritFromTheme",e);const t={...i.current};t.backgroundColor="#eeeeee",t.bold=!1,t.borderRadius=0,t.borderSize=1,t.borderColor="#313131",t.fontColor="#313131",t.fontSize=void 0,t.padding=r,t.inheritFromTheme=e,n(t),i.current=t},className:"mailpoet-automation-inherit-theme-toggle"}),l.inheritFromTheme?null:(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(Tz,{title:OF.x.I18n.t("formSettingsColor"),settings:[{label:OF.x.I18n.t("formSettingsStylesBackground"),colorValue:t.backgroundColor,gradientValue:t.gradient,onColorChange:(0,U.partial)(a,"backgroundColor"),onGradientChange:(0,U.partial)(a,"gradient")},{label:OF.x.I18n.t("formSettingsStylesFont"),colorValue:t.fontColor,onColorChange:(0,U.partial)(a,"fontColor")},{label:OF.x.I18n.t("formSettingsBorder"),colorValue:l.borderColor,onColorChange:(0,U.partial)(a,"borderColor")}]}),(0,zF.jsx)(fG,{value:t.fontSize,onChange:(0,U.partial)(a,"fontSize")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("formSettingsBold"),checked:l.bold||!1,onChange:(0,U.partial)(a,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,zF.jsx)(gG,{name:OF.x.I18n.t("formSettingsStylesFontFamily"),value:t.fontFamily||o,onChange:(0,U.partial)(a,"fontFamily")}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsInputPadding"),value:void 0!==l.padding?l.padding:r,min:0,max:30,allowReset:!0,onChange:(0,U.partial)(a,"padding")}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderSize"),value:void 0!==l.borderSize?l.borderSize:1,min:0,max:10,allowReset:!0,onChange:(0,U.partial)(a,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderRadius"),value:void 0!==l.borderRadius?l.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,U.partial)(a,"borderRadius")})]})]})})})}const yG=(0,zF.jsxs)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,zF.jsx)(tp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]}),_G={title:OF.x.I18n.t("blockSubmit"),description:OF.x.I18n.t("blockSubmitDescription"),icon:yG,category:"obligatory",attributes:{label:{type:"string",default:OF.x.I18n.t("blockSubmitLabel")},styles:{type:"object",default:{fullWidth:!0,inheritFromTheme:!0}}},supports:{html:!1,inserter:!1,multiple:!1},edit:function(e){let{attributes:t,setAttributes:n}=e;const r=(0,E.Z)((e=>e(WF).getFormSettings()),[]),o=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:t.label,onChange:e=>n({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,zF.jsx)(bG,{onChange:e=>n({styles:e}),styles:t.styles,formInputPadding:r.inputPadding,formFontFamily:r.fontFamily})]}),i=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit",borderRadius:void 0!==t.styles.borderRadius?`${t.styles.borderRadius}px`:0,borderWidth:void 0!==t.styles.borderSize?`${t.styles.borderSize}px`:"1px",borderColor:t.styles.borderColor||"transparent",borderStyle:"solid",fontSize:t.styles.fontSize?`${t.styles.fontSize}px`:"inherit",color:t.styles.fontColor||"inherit"};t.styles.fullWidth&&(i.width="100%"),void 0===t.styles.padding||t.styles.inheritFromTheme?void 0!==r.inputPadding&&(i.padding=r.inputPadding):i.padding=t.styles.padding,t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(i.backgroundColor=t.styles.backgroundColor),t.styles.gradient&&!t.styles.inheritFromTheme&&(i.backgroundColor=void 0,i.background=t.styles.gradient),t.styles.fontFamily&&!t.styles.inheritFromTheme&&(i.fontFamily=t.styles.fontFamily);const l=w()("mailpoet_submit",{button:t.styles.inheritFromTheme});return(0,zF.jsxs)(pz,{className:t.className,children:[o,(0,zF.jsx)("input",{className:l,type:"submit",value:t.label,"data-automation-id":"editor_submit_input",style:i})]})},save:()=>null},kG=(0,zF.jsxs)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,zF.jsx)(tp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function xG(e){let{attributes:t,setAttributes:n}=e;const r=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>n({label:e})}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,zF.jsx)(Nz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,zF.jsxs)(zF.Fragment,{children:[r,(0,zF.jsx)(Az,{className:t.className,name:"first_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}xG.propTypes={attributes:jF().shape({label:jF().string.isRequired,labelWithinInput:jF().bool.isRequired,mandatory:jF().bool.isRequired,className:jF().string,styles:Bz.isRequired}).isRequired,setAttributes:jF().func.isRequired};const wG={title:OF.x.I18n.t("blockFirstName"),description:OF.x.I18n.t("blockFirstNameDescription"),icon:kG,category:"fields",attributes:{label:{type:"string",default:OF.x.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:gz}},supports:{html:!1,multiple:!1},edit:xG,save:()=>null},CG=(0,zF.jsxs)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,zF.jsx)(tp.y$,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function EG(e){let{attributes:t,setAttributes:n}=e;const r=(0,zF.jsxs)(nh,{children:[(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:t.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>n({label:e})}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockMandatory"),checked:t.mandatory,onChange:e=>n({mandatory:e})})]})}),(0,zF.jsx)(Nz,{styles:t.styles,onChange:e=>n({styles:e})})]});return(0,zF.jsxs)(zF.Fragment,{children:[r,(0,zF.jsx)(Az,{className:t.className,name:"last_name",mandatory:t.mandatory,labelWithinInput:t.labelWithinInput,label:t.label,styles:t.styles})]})}EG.propTypes={attributes:jF().shape({label:jF().string.isRequired,labelWithinInput:jF().bool.isRequired,mandatory:jF().bool.isRequired,className:jF().string,styles:Bz.isRequired}).isRequired,setAttributes:jF().func.isRequired};const SG={title:OF.x.I18n.t("blockLastName"),description:OF.x.I18n.t("blockLastNameDescription"),icon:CG,category:"fields",attributes:{label:{type:"string",default:OF.x.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:gz}},supports:{html:!1,multiple:!1},edit:EG,save:()=>null},IG=(0,zF.jsx)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{d:"M9 19h12v-2H9v2zm0-6h12v-2H9v2zm0-8v2h12V5H9zm-4-.5c-.828 0-1.5.672-1.5 1.5S4.172 7.5 5 7.5 6.5 6.828 6.5 6 5.828 4.5 5 4.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5z"})})});var TG=n(70660);function NG(e){let{segment:t,removeSegment:n,onCheck:r}=e;return(0,zF.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,zF.jsx)(sS.C,{label:t.name,defaultChecked:!!t.isChecked,onChange:(0,U.partial)(r,t.id)},`check-${t.id}`),(0,zF.jsx)(Zz.Z,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,U.partial)(n,t.id)})]},t.id)}function BG(e){let{segments:t,updateSegment:n,removeSegment:r,onSegmentsReorder:o}=e;const[i,l]=(0,v.useState)(t);if((0,v.useEffect)((()=>{l(t)}),[t]),0===i.length)return null;const a=(e,t)=>{const r=i.find((t=>t.id===e));r.isChecked=t,n(r)};return(0,zF.jsx)(uU,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,r=[...i],[a]=r.splice(t,1);r.splice(n,0,a),l(r),o(r)},children:(0,zF.jsx)(HU,{droppableId:"droppable",children:e=>(0,zF.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[i.map(((e,t)=>(0,zF.jsx)(ZU,{draggableId:e.id,index:t,children:n=>(0,zF.jsx)("div",{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,children:(0,zF.jsx)(NG,{index:t,segment:e,onCheck:a,removeSegment:r},e.id)})},e.id))),e.placeholder]})})})}NG.propTypes={segment:jF().shape({name:jF().string.isRequired,isChecked:jF().bool,id:jF().string.isRequired}).isRequired,onCheck:jF().func.isRequired,removeSegment:jF().func.isRequired},BG.propTypes={segments:jF().arrayOf(jF().shape({name:jF().string.isRequired,isChecked:jF().bool,id:jF().string.isRequired}).isRequired).isRequired,updateSegment:jF().func.isRequired,removeSegment:jF().func.isRequired,onSegmentsReorder:jF().func.isRequired};const LG=(e,t)=>e.find((e=>e.id===t));function PG(e){let{label:t,onLabelChanged:n,segmentsAddedIntoSelection:r,addSegmentIntoSelection:o,setNewSelection:i}=e;const l=(0,E.Z)((e=>e(WF).getAllAvailableSegments()),[]),a=l.map((e=>({label:e.name,value:e.id}))).filter((e=>!LG(r,e.value)));return(0,zF.jsx)(nh,{children:(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(TG.Z,{children:(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("label"),value:t,"data-automation-id":"settings_first_name_label_input",onChange:n})}),(0,zF.jsx)(TG.Z,{children:a.length?(0,zF.jsx)(BT.Z,{label:`${OF.x.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:OF.x.I18n.t("settingsPleaseSelectList"),value:null},...a],onChange:e=>{const t=LG(l,e);o({name:t.name,isChecked:!1,id:e})}}):null}),(0,zF.jsx)(BG,{segments:r,updateSegment:e=>{i(r.map((t=>e.id!==t?t:e)))},removeSegment:e=>{i(r.filter((t=>e!==t.id)))},onSegmentsReorder:i})]})})})}function AG(e){let{attributes:t,setAttributes:n}=e;const r=(0,E.Z)((e=>e(WF).getAllAvailableSegments()),[]),o=(0,v.useMemo)((()=>t.values.map((e=>{const t={...e},n=r.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t.name=n?n.name:"",t}))),[t.values,r]),i=e=>e.map((e=>{const t={...e};return delete t.name,t}));return(0,zF.jsxs)(pz,{className:t.className,children:[(0,zF.jsx)(PG,{label:t.label,onLabelChanged:e=>n({label:e}),segmentsAddedIntoSelection:o,setNewSelection:e=>n({values:i(e)}),addSegmentIntoSelection:e=>n({values:i([...t.values,e])})}),(0,zF.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:t.label}),0===t.values.length?(0,zF.jsx)("p",{className:"mailpoet_error",children:OF.x.I18n.t("blockSegmentSelectNoLists")}):o.map((e=>(0,zF.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,zF.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id)))]})}PG.propTypes={label:jF().string.isRequired,onLabelChanged:jF().func.isRequired,addSegmentIntoSelection:jF().func.isRequired,setNewSelection:jF().func.isRequired,segmentsAddedIntoSelection:jF().arrayOf(jF().shape({name:jF().string.isRequired,isChecked:jF().bool,id:jF().string.isRequired}).isRequired).isRequired},AG.propTypes={attributes:jF().shape({label:jF().string.isRequired,className:jF().string,values:jF().arrayOf(jF().shape({isChecked:jF().bool,id:jF().string.isRequired})).isRequired}).isRequired,setAttributes:jF().func.isRequired};const DG={title:OF.x.I18n.t("blockSegmentSelect"),description:OF.x.I18n.t("blockLastNameDescription"),icon:IG,category:"fields",attributes:{label:{type:"string",default:OF.x.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:AG,save:()=>null},RG=(0,zF.jsx)(tp.Wj,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,zF.jsx)(tp.y$,{d:"M4.5,11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5V11z M7,10.5h1.5V15H10v-4.5h1.5V9H7V10.5z M14.5,10l-1-1H12v6h1.5v-3.9 l1,1l1-1V15H17V9h-1.5L14.5,10z M19.5,13.5V9H18v6h5v-1.5H19.5z"})});var MG=n(73995);const OG=function(){const{MutationObserver:e}=window;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vmin|vmax|vh|vw)$/.test(e.style[t])&&(e.style[t]="")}))}e&&document.body&&window.parent&&(new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0))},ZG="\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n";var FG=function(e){let{html:t="",title:n="",type:r,styles:o=[],scripts:i=[],onFocus:l}=e;const a=(0,v.useRef)(),[s,c]=(0,v.useState)(0),[u,d]=(0,v.useState)(0);function p(){try{var e,t;return!(null===(e=a.current)||void 0===e||null===(t=e.contentDocument)||void 0===t||!t.body)}catch(e){return!1}}function m(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!p())return;const{contentDocument:l,ownerDocument:s}=a.current;if(!e&&null!==(null==l?void 0:l.body.getAttribute("data-resizable-iframe-connected")))return;const c=(0,v.createElement)("html",{lang:s.documentElement.lang,className:r},(0,v.createElement)("head",null,(0,v.createElement)("title",null,n),(0,v.createElement)("style",{dangerouslySetInnerHTML:{__html:ZG}}),o.map(((e,t)=>(0,v.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,v.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:r},(0,v.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),(0,v.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${OG.toString()})();`}}),i.map((e=>(0,v.createElement)("script",{key:e,src:e})))));l.open(),l.write(""+(0,mn.ZP)(c)),l.close()}return(0,v.useEffect)((()=>{var e;function t(){m(!1)}function n(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(c(n.width),d(n.height))}m();const r=a.current,o=null==r||null===(e=r.ownerDocument)||void 0===e?void 0:e.defaultView;return null==r||r.addEventListener("load",t,!1),null==o||o.addEventListener("message",n),()=>{null==r||r.removeEventListener("load",t,!1),null==o||o.addEventListener("message",n)}}),[]),(0,v.useEffect)((()=>{m()}),[n,o,i]),(0,v.useEffect)((()=>{m(!0)}),[t,r]),(0,v.createElement)("iframe",{ref:(0,vl.Z)([a,(0,bl.Z)((e=>{const{ownerDocument:t}=e;if(!t)return;const{defaultView:n}=t;if(n)return n.addEventListener("blur",r),()=>{n.removeEventListener("blur",r)};function r(){t&&t.activeElement===e&&e.focus()}}),[])]),title:n,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:l,width:Math.ceil(s),height:Math.ceil(u)})};function jG(e){let{attributes:t,setAttributes:n,clientId:r}=e;const o=bp("color.palette"),{fontColor:i,fontSize:l,alignment:a,fontFamily:s}=(0,E.Z)((e=>{const t=e(WF).getFormSettings(),n=GF(o,e(WF).getClosestParentAttribute(r,"backgroundColor"),e(WF).getClosestParentAttribute(r,"customBackgroundColor")),i=GF(o,e(WF).getClosestParentAttribute(r,"textColor"),e(WF).getClosestParentAttribute(r,"customTextColor"));return{backgroundColor:n||t.backgroundColor,fontColor:i||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}}),[]),[c,u]=(0,v.useState)(t.content),d=(0,v.useCallback)((0,U.debounce)((e=>{u(e)}),300),[]),p=(0,zF.jsx)(nh,{children:(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),initialOpen:!0,children:[(0,zF.jsx)(MG.Z,{label:OF.x.I18n.t("blockCustomHtmlContentLabel"),value:t.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{n({content:e}),d(e)}}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("blockCustomHtmlNl2br"),checked:t.nl2br,onChange:e=>n({nl2br:e})})]})})}),m=t.nl2br?["body { white-space: pre-line; }"]:[];m.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),i?m.push(` body {color: ${i};}`):m.push(` body {color: ${getComputedStyle(document.body).color};}`),l?m.push(` body {font-size: ${l}px }`):m.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),a&&m.push(` body {text-align: ${a}}`),s&&m.push(` body {font-family: "${s}"}`);const f=`${c}_${m}`;return(0,zF.jsxs)(pz,{className:t.className,children:[p,(0,zF.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,zF.jsx)(FG,{html:c,styles:m},f)})]})}jG.propTypes={attributes:jF().shape({content:jF().string.isRequired,nl2br:jF().bool.isRequired,className:jF().string}).isRequired,setAttributes:jF().func.isRequired,clientId:jF().string.isRequired};const zG={title:OF.x.I18n.t("blockCustomHtml"),description:OF.x.I18n.t("blockCustomHtmlDescription"),icon:RG,category:"fields",attributes:{content:{type:"string",default:OF.x.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:jG,save:()=>null},HG=(0,zF.jsx)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,zF.jsx)(tp.G,{children:(0,zF.jsx)(tp.y$,{d:"m 347,44.407738 c 25.64881,0 46.33333,21.800595 46.33333,47.96131 V 299.03869 h 195.26191 c 24.82143,0 45.50595,21.8006 45.50595,47.96131 0,27.03274 -20.68452,48.83333 -45.50595,48.83333 H 393.33333 v 205.79762 c 0,26.16072 -20.68452,47.96131 -46.33333,47.96131 -24.82143,0 -45.50595,-21.80059 -45.50595,-47.96131 V 395.83333 H 105.40476 c -24.821427,0 -45.50595,-21.80059 -45.50595,-48.83333 0,-26.16071 20.684523,-47.96131 45.50595,-47.96131 H 301.49405 V 92.369048 c 0,-26.160715 20.68452,-47.96131 45.50595,-47.96131 z",fillRule:"evenodd",clipRule:"evenodd"})})}),VG=[{value:"text",label:OF.x.I18n.t("customFieldTypeText")},{value:"textarea",label:OF.x.I18n.t("customFieldTypeTextarea")},{value:"radio",label:OF.x.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:OF.x.I18n.t("customFieldTypeCheckbox")},{value:"select",label:OF.x.I18n.t("customFieldTypeSelect")},{value:"date",label:OF.x.I18n.t("customFieldTypeDate")}];function WG(e){let{dateSettings:t,onSubmit:n}=e;const[r,o]=(0,v.useState)("text"),[i,l]=(0,v.useState)(null),[a,s]=(0,v.useState)({}),c=i&&!(0,U.isEmpty)(a)&&!1!==a.isValid,u=t.dateTypes[0].value,d=t.dateFormats[u][0];return(0,zF.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,zF.jsx)("hr",{}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("selectCustomFieldType"),options:VG,"data-automation-id":"create_custom_field_type_select",onChange:e=>{s({}),o(e)}}),(0,zF.jsx)(uf.Z,{label:OF.x.I18n.t("customFieldName"),onChange:l,"data-automation-id":"create_custom_field_name_input"}),(0,zF.jsx)("hr",{}),(()=>{switch(r){case"checkbox":return(0,zF.jsx)(rG,{mandatory:!!a.mandatory&&a.mandatory,isChecked:!!a.isChecked&&a.isChecked,checkboxLabel:a.checkboxLabel?a.checkboxLabel:"",onChange:s});case"date":return(0,zF.jsx)(lz,{dateSettings:t,mandatory:!!a.mandatory&&a.mandatory,dateFormat:a.dateFormat?a.dateFormat:d,dateType:a.dateType?a.dateType:u,defaultToday:!!a.defaultToday&&a.defaultToday,onChange:s});case"radio":case"select":return(0,zF.jsx)($U,{mandatory:!!a.mandatory&&a.mandatory,values:a.values?a.values:[{name:"",id:Math.random().toString()}],onChange:s});default:return(0,zF.jsx)(xz,{mandatory:!!a.mandatory&&a.mandatory,validate:a.validate?a.validate:"",fieldType:r,onChange:s})}})(),(0,zF.jsx)(Mo.ZP,{isSecondary:!0,disabled:!c,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:i,type:r,params:mz(r,a)};n(e)},children:OF.x.I18n.t("blockCreateButton")})]})}function $G(e){let{clientId:t}=e;const{createCustomField:n}=(0,S.Z)(WF),r=(0,E.Z)((e=>e(WF).getDateSettingsData()),[]),o=(0,E.Z)((e=>e(WF).getIsCustomFieldCreating()),[]);return(0,zF.jsx)(NR,{icon:(0,zF.jsx)(k_,{icon:HG,showColors:!0}),label:OF.x.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:o?(0,zF.jsx)(zw.ZP,{}):(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:OF.x.I18n.t("blockAddCustomFieldDescription")}),(0,zF.jsx)(WG,{onSubmit:e=>{n(e,t)},dateSettings:r})]})})}WG.propTypes={dateSettings:jF().shape({dateTypes:jF().arrayOf(jF().shape({label:jF().string,value:jF().string})),dateFormats:jF().objectOf(jF().arrayOf(jF().string)),months:jF().arrayOf(jF().string)}).isRequired,onSubmit:jF().func.isRequired},$G.propTypes={clientId:jF().string.isRequired};const UG={title:OF.x.I18n.t("blockAddCustomField"),description:OF.x.I18n.t("blockAddCustomFieldDescription"),icon:HG,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:$G,save:()=>null};var GG=n(42173);function qG(e){let t,{doc:n}=qG;n||(n=document.implementation.createHTMLDocument(""),qG.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var KG=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:r,...o}=e;return{...o,style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:r,customBackgroundColor:o,textColor:i,customTextColor:l}=t,a=SB("background-color",r),s=SB("color",i),c=w()({"has-background":r||o,"has-text-color":i||l,[a]:a,[s]:s,[`are-vertically-aligned-${n}`]:n}),u={backgroundColor:a?void 0:o,color:s?void 0:l};return(0,v.createElement)("div",{className:c||void 0,style:u},(0,v.createElement)(FI.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==qG(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=qG(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>ke("core/column",{},e))),{columns:r,...o}=e;return[{...o,isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return(0,v.createElement)("div",{className:`has-${n}-columns`},(0,v.createElement)(FI.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...r}=e;return[e={...r,isStackedOnMobile:!0},t]},save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:r}=t,o=w()(`has-${r}-columns`,{[`are-vertically-aligned-${n}`]:n});return(0,v.createElement)("div",{className:o},(0,v.createElement)(FI.Content,null))}}];const YG=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function XG(e,t){const{width:n=100/t}=e.attributes;return YG(n)}function JG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>e+XG(n,t)),0)}function QG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>{const r=XG(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}function eq(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const r=JG(e,n);return(0,U.mapValues)(QG(e,n),(e=>YG(t*e/r)))}function tq(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const nq=["core/column"],rq=(0,fh.Z)(((e,t,n)=>({updateAlignment(r){const{clientId:o,setAttributes:i}=t,{updateBlockAttributes:l}=e(ku),{getBlockOrder:a}=n.select(ku);i({verticalAlignment:r}),a(o).forEach((e=>{l(e,{verticalAlignment:r})}))},updateColumns(r,o){const{clientId:i}=t,{replaceInnerBlocks:l}=e(ku),{getBlocks:a}=n.select(ku);let s=a(i);const c=function(e){return e.every((e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}))}(s),u=o>r;if(u&&c){const e=YG(100/o);s=[...tq(s,eq(s,100-e)),...Array.from({length:o-r}).map((()=>ke("core/column",{width:`${e}%`})))]}else u?s=[...s,...Array.from({length:o-r}).map((()=>ke("core/column")))]:(s=s.slice(0,-(r-o)),c&&(s=tq(s,eq(s,100))));l(i,s)}})))((function(e){let{attributes:t,setAttributes:n,updateAlignment:r,updateColumns:o,clientId:i}=e;const{isStackedOnMobile:l,verticalAlignment:a}=t,{count:s}=(0,E.Z)((e=>({count:e(ku).getBlockCount(i)})),[i]),c=ZI(Ky({className:w()({[`are-vertically-aligned-${a}`]:a,"is-not-stacked-on-mobile":!l})}),{allowedBlocks:nq,orientation:"horizontal",renderAppender:!1});return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,null,(0,v.createElement)(dp,{onChange:r,value:a})),(0,v.createElement)(nh,null,(0,v.createElement)(pf.Z,null,(0,v.createElement)(iN,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Columns"),value:s,onChange:e=>o(s,e),min:1,max:Math.max(6,s)}),s>6&&(0,v.createElement)(DL.Z,{status:"warning",isDismissible:!1},(0,N.__)("This column count exceeds the recommended amount and may cause visual breakage.")),(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}))),(0,v.createElement)("div",c))}));function oq(e){let{clientId:t,name:n,setAttributes:r}=e;const{blockType:o,defaultVariation:i,variations:l}=(0,E.Z)((e=>{const{getBlockVariations:t,getBlockType:r,getDefaultBlockVariation:o}=e(Xt);return{blockType:r(n),defaultVariation:o(n,"block"),variations:t(n,"block")}}),[n]),{replaceInnerBlocks:a}=(0,S.Z)(ku),s=Ky();return(0,v.createElement)("div",s,(0,v.createElement)(LR,{icon:(0,U.get)(o,["icon","src"]),label:(0,U.get)(o,["title"]),variations:l,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;e.attributes&&r(e.attributes),e.innerBlocks&&a(t,xe(e.innerBlocks),!0)},allowSkip:!0}))}var iq=[{name:"one-column-full",title:(0,N.__)("100"),description:(0,N.__)("One column"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,N.__)("50 / 50"),description:(0,N.__)("Two columns; equal split"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,N.__)("33 / 66"),description:(0,N.__)("Two columns; one-third, two-thirds split"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,N.__)("66 / 33"),description:(0,N.__)("Two columns; two-thirds, one-third split"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,N.__)("33 / 33 / 33"),description:(0,N.__)("Three columns; equal split"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,N.__)("25 / 50 / 25"),description:(0,N.__)("Three columns; wide center column"),icon:(0,v.createElement)(tp.Wj,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,v.createElement)(tp.y$,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}];const lq={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map((e=>{let{name:n,attributes:r,innerBlocks:o}=e;return["core/column",{width:`${t}%`},[[n,{...r},o]]]}));return ke("core/columns",{},xe(n))},isMatch:(e,t)=>{let{length:n}=e;return(1!==t.length||"core/columns"!==t[0].name)&&n&&n<=6}},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:r,textColor:o,style:i,mediaAlt:l,mediaId:a,mediaPosition:s,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:m}=e;let f;f="image"!==u&&u?["core/video",{id:a,src:d}]:["core/image",{id:a,alt:l,url:d,sizeSlug:c,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const h=[["core/column",{width:`${p}%`},[f]],["core/column",{width:100-p+"%"},t]];return"right"===s&&h.reverse(),ke("core/columns",{align:n,backgroundColor:r,textColor:o,style:i,verticalAlignment:m},xe(h))}}],to:[{type:"block",blocks:["*"],transform:(e,t)=>t.flatMap((e=>e.innerBlocks))}]};var aq=lq;const sq={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:cq}=sq,uq={icon:GG.Z,variations:iq,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,N.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,N.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,N.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,N.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:KG,edit:e=>{const{clientId:t}=e,n=(0,E.Z)((e=>e(ku).getBlocks(t).length>0),[t])?rq:oq;return(0,v.createElement)(n,e)},save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,verticalAlignment:r}=t,o=w()({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!n}),i=Ky.save({className:o}),l=ZI.save(i);return(0,v.createElement)("div",l)},transforms:aq},dq="core/columns",pq={name:dq,examples:null,deprecated:null,save:()=>null},mq={...sq,...uq,...pq,category:"design",supports:{...sq.supports,anchor:!1}};var fq=n(36420);const hq=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:`${e.width}%`}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=w()({[`is-vertically-aligned-${n}`]:n}),i={flexBasis:r+"%"};return(0,v.createElement)("div",{className:o,style:i},(0,v.createElement)(FI.Content,null))}}];var gq=hq;const vq={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalLayout:!0}},{name:bq}=vq,yq={icon:fq.Z,edit:function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:r,allowedBlocks:o},setAttributes:i,clientId:l}=e;const a=w()("block-core-columns",{[`is-vertically-aligned-${t}`]:t}),s=Wp({availableUnits:bp("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:c,hasChildBlocks:u,rootClientId:d}=(0,E.Z)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(ku),r=n(l);return{hasChildBlocks:t(l).length>0,rootClientId:r,columnsIds:t(r)}}),[l]),{updateBlockAttributes:p}=(0,S.Z)(ku),m=Number.isFinite(n)?n+"%":n,f=Ky({className:a,style:m?{flexBasis:m}:void 0}),h=c.length,g=c.indexOf(l)+1,b=(0,N.sprintf)((0,N.__)("%1$s (%2$d of %3$d)"),f["aria-label"],g,h),y=ZI({...f,"aria-label":b},{templateLock:r,allowedBlocks:o,renderAppender:u?void 0:FI.ButtonBlockAppender});return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,null,(0,v.createElement)(dp,{onChange:e=>{i({verticalAlignment:e}),p(d,{verticalAlignment:null})},value:t})),(0,v.createElement)(nh,null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Column settings")},(0,v.createElement)(rm,{label:(0,N.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,i({width:e})},units:s}))),(0,v.createElement)("div",y))},save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:r}=t,o=w()({[`is-vertically-aligned-${n}`]:n});let i;if(r&&/\d/.test(r)){let e=Number.isFinite(r)?r+"%":r;if(!Number.isFinite(r)&&null!=r&&r.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(r)*t)/t+"%"}i={flexBasis:e}}const l=Ky.save({className:o,style:i}),a=ZI.save(l);return(0,v.createElement)("div",a)},deprecated:gq},_q="core/column",kq={name:_q,examples:null,deprecated:null,save:()=>null},xq={...vq,...yq,...kq,category:"design",supports:{...vq.supports,anchor:!1}};var wq=n(78991);const Cq={className:!1,anchor:!0},Eq={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},Sq=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:n,...r}=e;return{...r,style:t}},Iq=["left","right","center"],Tq=e=>{const{align:t,...n}=e;return Iq.includes(t)?{...n,textAlign:t}:e},Nq={supports:Cq,attributes:{...Eq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Sq(Tq(e)),save(e){let{attributes:t}=e;const{align:n,level:r,content:o,textColor:i,customTextColor:l}=t,a="h"+r,s=SB("color",i),c=w()({[s]:s});return(0,v.createElement)(gZ.Content,{className:c||void 0,tagName:a,style:{textAlign:n,color:s?void 0:l},value:o})}},Bq={attributes:{...Eq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Sq(Tq(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=SB("color",l),c=w()({[s]:s,[`has-text-align-${n}`]:n});return(0,v.createElement)(gZ.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})},supports:Cq},Lq={supports:Cq,attributes:{...Eq,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Sq(Tq(e)),save(e){let{attributes:t}=e;const{align:n,content:r,customTextColor:o,level:i,textColor:l}=t,a="h"+i,s=SB("color",l),c=w()({[s]:s,"has-text-color":l||o,[`has-text-align-${n}`]:n});return(0,v.createElement)(gZ.Content,{className:c||void 0,tagName:a,style:{color:s?void 0:o},value:r})}};var Pq=[{supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save(e){let{attributes:t}=e;const{textAlign:n,content:r,level:o}=t,i="h"+o,l=w()({[`has-text-align-${n}`]:n});return(0,v.createElement)(i,Ky.save({className:l}),(0,v.createElement)(gZ.Content,{value:r}))}},{supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:Eq,isEligible:e=>{let{align:t}=e;return Iq.includes(t)},migrate:Tq,save(e){let{attributes:t}=e;const{align:n,content:r,level:o}=t,i="h"+o,l=w()({[`has-text-align-${n}`]:n});return(0,v.createElement)(i,Ky.save({className:l}),(0,v.createElement)(gZ.Content,{value:r}))}},Lq,Bq,Nq];function Aq(e){let{level:t,isPressed:n=!1}=e;const r={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return r.hasOwnProperty(t)?(0,v.createElement)(tp.Wj,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},(0,v.createElement)(tp.y$,{d:r[t]})):null}const Dq=[1,2,3,4,5,6],Rq={className:"block-library-heading-level-dropdown"};function Mq(e){let{selectedLevel:t,onChange:n}=e;return(0,v.createElement)(Mu,{popoverProps:Rq,icon:(0,v.createElement)(Aq,{level:t}),label:(0,N.__)("Change heading level"),controls:Dq.map((e=>{{const r=e===t;return{icon:(0,v.createElement)(Aq,{level:e,isPressed:r}),label:(0,N.sprintf)((0,N.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}}))})}const Oq={},Zq=(e,t)=>{const n=(e=>Qe()((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""))(t);if(""===n)return null;delete Oq[e];let r=n,o=0;for(;Object.values(Oq).includes(r);)o+=1,r=n+"-"+o;return r},Fq=(e,t)=>{Oq[e]=t};const{name:jq}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},zq={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,anchor:n,align:r}=e;return ke(jq,{content:t,anchor:n,textAlign:r})}))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;const r={children:t,attributes:n?[]:["style","id"]};return{h1:r,h2:r,h3:r,h4:r,h5:r,h6:r}},transform(e){const t=Cr(jq,e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),ke(jq,t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>ke(jq,{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>ke(jq,{level:e,content:t})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,textAlign:n}=e;return ke("core/paragraph",{content:t,align:n})}))}]};var Hq=zq;const Vq={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:Wq}=Vq,$q={icon:wq.Z,example:{attributes:{content:(0,N.__)("Code is Poetry"),level:2}},__experimentalLabel(e,t){let{context:n}=t;const{content:r,level:o}=e;return"list-view"===n&&r?r:"accessibility"===n?r&&0!==r.length?(0,N.sprintf)((0,N.__)("Level %1$s. %2$s"),o,r):(0,N.sprintf)((0,N.__)("Level %s. Empty."),o):void 0},transforms:Hq,deprecated:Pq,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:r,onReplace:o,style:i,clientId:l}=e;const{textAlign:a,content:s,level:c,placeholder:u,anchor:d}=t,p="h"+c,m=Ky({className:w()({[`has-text-align-${a}`]:a}),style:i}),{canGenerateAnchors:f}=(0,E.Z)((e=>{const{getGlobalBlockCount:t,getSettings:n}=e(ku);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:h}=(0,S.Z)(ku);return(0,v.useEffect)((()=>{if(f)return!d&&s&&(h(),n({anchor:Zq(l,s)})),Fq(l,d),()=>Fq(l,null)}),[d,s,l,f]),(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,{group:"block"},(0,v.createElement)(Mq,{selectedLevel:c,onChange:e=>n({level:e})}),(0,v.createElement)(IR,{value:a,onChange:e=>{n({textAlign:e})}})),(0,v.createElement)(gZ,(0,Po.Z)({identifier:"content",tagName:p,value:s,onChange:e=>{const t={content:e};!f||d&&e&&Zq(l,s)!==d||(t.anchor=Zq(l,e)),n(t)},onMerge:r,onSplit:(e,n)=>{let r;var o;return r=n||e?ke("core/heading",{...t,content:e}):ke(null!==(o=de())&&void 0!==o?o:"core/heading"),n&&(r.clientId=l),r},onReplace:o,onRemove:()=>o([]),"aria-label":(0,N.__)("Heading text"),placeholder:u||(0,N.__)("Heading"),textAlign:a},ci.Z.isNative&&{deleteEnter:!0},m)))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:r,level:o}=t,i="h"+o,l=w()({[`has-text-align-${n}`]:n});return(0,v.createElement)(i,Ky.save({className:l}),(0,v.createElement)(gZ.Content,{value:r}))}},Uq="core/heading",Gq={name:Uq,examples:null,deprecated:null,save:()=>null},qq={...Vq,...$q,...Gq,category:"design",supports:{...Vq.supports,html:!1}};var Kq=n(29199);const Yq={className:!1},Xq={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},Jq=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:n,customBackgroundColor:r,customFontSize:o,...i}=e;return{...i,style:t}},{style:Qq,...eK}=Xq,tK=[{supports:Yq,attributes:{...eK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,direction:i}=t,l=w()({"has-drop-cap":n!==((0,N.isRTL)()?"left":"right")&&"center"!==n&&o,[`has-text-align-${n}`]:n});return(0,v.createElement)("p",Ky.save({className:l,dir:i}),(0,v.createElement)(gZ.Content,{value:r}))}},{supports:Yq,attributes:{...eK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Jq,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:u,direction:d}=t,p=SB("color",l),m=SB("background-color",i),f=QP(c),h=w()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[`has-text-align-${n}`]:n,[f]:f,[p]:p,[m]:m}),g={backgroundColor:m?void 0:a,color:p?void 0:s,fontSize:f?void 0:u};return(0,v.createElement)(gZ.Content,{tagName:"p",style:g,className:h||void 0,value:r,dir:d})}},{supports:Yq,attributes:{...eK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Jq,save(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,backgroundColor:i,textColor:l,customBackgroundColor:a,customTextColor:s,fontSize:c,customFontSize:u,direction:d}=t,p=SB("color",l),m=SB("background-color",i),f=QP(c),h=w()({"has-text-color":l||s,"has-background":i||a,"has-drop-cap":o,[f]:f,[p]:p,[m]:m}),g={backgroundColor:m?void 0:a,color:p?void 0:s,fontSize:f?void 0:u,textAlign:n};return(0,v.createElement)(gZ.Content,{tagName:"p",style:g,className:h||void 0,value:r,dir:d})}},{supports:Yq,attributes:{...eK,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:Jq,save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,customBackgroundColor:s,customTextColor:c,fontSize:u,customFontSize:d}=t,p=SB("color",a),m=SB("background-color",l),f=u&&`is-${u}-text`,h=w()({[`align${n}`]:n,"has-background":l||s,"has-drop-cap":i,[f]:f,[p]:p,[m]:m}),g={backgroundColor:m?void 0:s,color:p?void 0:c,fontSize:f?void 0:d,textAlign:r};return(0,v.createElement)(gZ.Content,{tagName:"p",style:g,className:h||void 0,value:o})}},{supports:Yq,attributes:{...eK,fontSize:{type:"number"}},save(e){let{attributes:t}=e;const{width:n,align:r,content:o,dropCap:i,backgroundColor:l,textColor:a,fontSize:s}=t,c=w()({[`align${n}`]:n,"has-background":l,"has-drop-cap":i}),u={backgroundColor:l,color:a,fontSize:s,textAlign:r};return(0,v.createElement)("p",{style:u,className:c||void 0},o)},migrate:e=>Jq({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:Yq,attributes:{...Xq,content:{type:"string",source:"html",default:""}},save(e){let{attributes:t}=e;return(0,v.createElement)(pn.Z,null,t.content)},migrate:e=>e}];var nK=tK,rK=n(9098);function oK(e){const{batch:t}=(0,yl.Z)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:o,insertBlock:i}=(0,S.Z)(ku),{getBlockRootClientId:l,getBlockIndex:a,getBlockOrder:s,getBlockName:c,getBlock:u,getNextBlockClientId:d}=(0,E.Z)(ku),p=(0,v.useRef)(e);return p.current=e,(0,bl.Z)((e=>{function m(e){if(e.defaultPrevented)return;if(e.keyCode!==Al.ENTER)return;const{content:m,clientId:f}=p.current;if(m.length)return;const h=l(f);if(!he(c(h),"__experimentalOnEnter",!1))return;const g=s(h);e.preventDefault();const v=g.indexOf(f);if(v===g.length-1)return void n([f],h,l(h),a(h)+1);const b=u(h);t((()=>{o([h]);const e=a(h);r(h,b.innerBlocks.slice(0,v)),r(d(h),b.innerBlocks.slice(v+1)),i(ke("core/paragraph"),e+1,l(h),!0)}))}return e.addEventListener("keydown",m),()=>{e.removeEventListener("keydown",m)}}),[])}function iK(e){let{direction:t,setDirection:n}=e;return(0,N.isRTL)()&&(0,v.createElement)(Fo,{icon:rK.Z,title:(0,N._x)("Left to right","editor button"),isActive:"ltr"===t,onClick:()=>{n("ltr"===t?void 0:"ltr")}})}function lK(e){return e===((0,N.isRTL)()?"left":"right")||"center"===e}const{name:aK}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},sK={from:[{type:"raw",priority:20,selector:"p",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;return{p:{children:t,attributes:n?[]:["style","id"]}}},transform(e){const t=Cr(aK,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),ke(aK,t)}}]};var cK=sK;const uK={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:dK}=uK,pK={icon:Kq.Z,example:{attributes:{content:(0,N.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t}=e;return t&&0!==t.length?t:(0,N.__)("Empty")}},transforms:cK,deprecated:nK,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function(e){let{attributes:t,mergeBlocks:n,onReplace:r,onRemove:o,setAttributes:i,clientId:l}=e;const{align:a,content:s,direction:c,dropCap:u,placeholder:d}=t,p=bp("typography.dropCap"),m=Ky({ref:oK({clientId:l,content:s}),className:w()({"has-drop-cap":!lK(a)&&u,[`has-text-align-${a}`]:a}),style:{direction:c}});let f;return f=lK(a)?(0,N.__)("Not available for aligned text."):u?(0,N.__)("Showing large initial letter."):(0,N.__)("Toggle to show a large initial letter."),(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,{group:"block"},(0,v.createElement)(IR,{value:a,onChange:e=>i({align:e,dropCap:!lK(e)&&u})}),(0,v.createElement)(iK,{direction:c,setDirection:e=>i({direction:e})})),p&&(0,v.createElement)(nh,{group:"typography"},(0,v.createElement)(nT,{hasValue:()=>!!u,label:(0,N.__)("Drop cap"),onDeselect:()=>i({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:l},(0,v.createElement)(jd.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Drop cap"),checked:!!u,onChange:()=>i({dropCap:!u}),help:f,disabled:!!lK(a)}))),(0,v.createElement)(gZ,(0,Po.Z)({identifier:"content",tagName:"p"},m,{value:s,onChange:e=>i({content:e}),onSplit:(e,n)=>{let r;(n||e)&&(r={...t,content:e});const o=ke("core/paragraph",r);return n&&(o.clientId=l),o},onMerge:n,onReplace:r,onRemove:o,"aria-label":s?(0,N.__)("Paragraph block"):(0,N.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:d||(0,N.__)("Type / to choose a block"),"data-custom-placeholder":!!d||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))},save:function(e){let{attributes:t}=e;const{align:n,content:r,dropCap:o,direction:i}=t,l=w()({"has-drop-cap":n!==((0,N.isRTL)()?"left":"right")&&"center"!==n&&o,[`has-text-align-${n}`]:n});return(0,v.createElement)("p",Ky.save({className:l,dir:i}),(0,v.createElement)(gZ.Content,{value:r}))}},mK="core/paragraph",fK={name:mK,examples:null,deprecated:null,save:()=>null},hK={...uK,...pK,...fK,category:"design",supports:{...uK.supports,html:!1,anchor:!1}};var gK=n(57341);const vK={align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},bK={anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}}},yK=[{attributes:vK,supports:bK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:f}=t,h=(0,U.isEmpty)(a)?void 0:a,g=w()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u}),b=(0,v.createElement)("img",{src:n,alt:r,className:d?`wp-image-${d}`:null,width:c,height:u,title:f}),y=(0,v.createElement)(v.Fragment,null,l?(0,v.createElement)("a",{className:s,href:l,target:p,rel:h},b):b,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{tagName:"figcaption",value:o}));return(0,v.createElement)("figure",Ky.save({className:g}),y)}},{attributes:{...vK,title:{type:"string",source:"attribute",selector:"img",attribute:"title"},sizeSlug:{type:"string"}},supports:bK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:f}=t,h=(0,U.isEmpty)(a)?void 0:a,g=w()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u}),b=(0,v.createElement)("img",{src:n,alt:r,className:d?`wp-image-${d}`:null,width:c,height:u,title:f}),y=(0,v.createElement)(v.Fragment,null,l?(0,v.createElement)("a",{className:s,href:l,target:p,rel:h},b):b,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{tagName:"figcaption",value:o}));return"left"===i||"right"===i||"center"===i?(0,v.createElement)("div",Ky.save(),(0,v.createElement)("figure",{className:g},y)):(0,v.createElement)("figure",Ky.save({className:g}),y)}},{attributes:vK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,u=w()({[`align${i}`]:i,"is-resized":a||s}),d=(0,v.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,v.createElement)("figure",{className:u},l?(0,v.createElement)("a",{href:l},d):d,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{tagName:"figcaption",value:o}))}},{attributes:vK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s,id:c}=t,u=(0,v.createElement)("img",{src:n,alt:r,className:c?`wp-image-${c}`:null,width:a,height:s});return(0,v.createElement)("figure",{className:i?`align${i}`:null},l?(0,v.createElement)("a",{href:l},u):u,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{tagName:"figcaption",value:o}))}},{attributes:vK,save(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,width:a,height:s}=t,c=a||s?{width:a,height:s}:{},u=(0,v.createElement)("img",(0,Po.Z)({src:n,alt:r},c));let d={};return a?d={width:a}:"left"!==i&&"right"!==i||(d={maxWidth:"50%"}),(0,v.createElement)("figure",{className:i?`align${i}`:null,style:d},l?(0,v.createElement)("a",{href:l},u):u,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{tagName:"figcaption",value:o}))}}];var _K=yK,kK=n(85673);const xK=()=>{},wK={bottom:"bottom",corner:"corner"};const CK=(0,Ju.Z)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),EK=(0,Ju.Z)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),SK=(0,Ju.Z)("div",{target:"e1wq7y4k1"})("background:",ed.D.gray[900],";border-radius:2px;box-sizing:border-box;font-size:12px;color:",ed.D.ui.textDark,";padding:4px 8px;position:relative;"),IK=(0,Ju.Z)(yE.Z,{target:"e1wq7y4k0"})("&&&{color:",ed.D.ui.textDark,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),TK=(0,v.forwardRef)((function(e,t){let{label:n,position:r=wK.corner,zIndex:o=1e3,...i}=e;const l=!!n,a=r===wK.bottom,s=r===wK.corner;if(!l)return null;let c={opacity:l?1:void 0,zIndex:o},u={};return a&&(c={...c,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},u={transform:"translate(0, 100%)"}),s&&(c={...c,position:"absolute",top:4,right:(0,N.isRTL)()?void 0:4,left:(0,N.isRTL)()?4:void 0}),(0,v.createElement)(EK,(0,Po.Z)({"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:t,style:c},i),(0,v.createElement)(SK,{className:"components-resizable-tooltip__tooltip",style:u},(0,v.createElement)(IK,{as:"span"},n)))}));var NK=TK;const BK=()=>{},LK=(0,v.forwardRef)((function(e,t){let{axis:n,className:r,fadeTimeout:o=180,isVisible:i=!0,labelRef:l,onResize:a=BK,position:s=wK.bottom,showPx:c=!0,zIndex:u=1e3,...d}=e;const{label:p,resizeListener:m}=function(e){let{axis:t,fadeTimeout:n=180,onResize:r=xK,position:o=wK.bottom,showPx:i=!1}=e;const[l,a]=ud(),s=!!t,[c,u]=(0,v.useState)(!1),[d,p]=(0,v.useState)(!1),{width:m,height:f}=a,h=(0,v.useRef)(f),g=(0,v.useRef)(m),b=(0,v.useRef)(),y=(0,v.useCallback)((()=>{b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>{s||(u(!1),p(!1))}),n)}),[n,s]);(0,v.useEffect)((()=>{if(null===m&&null===f)return;const e=m!==g.current,t=f!==h.current;if(e||t){if(m&&!g.current&&f&&!h.current)return g.current=m,void(h.current=f);e&&(u(!0),g.current=m),t&&(p(!0),h.current=f),r({width:m,height:f}),y()}}),[m,f,r,y]);const _=function(e){let{axis:t,height:n,moveX:r=!1,moveY:o=!1,position:i=wK.bottom,showPx:l=!1,width:a}=e;if(!r&&!o)return;if(i===wK.corner)return`${a} x ${n}`;const s=l?" px":"";if(t){if("x"===t&&r)return`${a}${s}`;if("y"===t&&o)return`${n}${s}`}return r&&o?`${a} x ${n}`:r?`${a}${s}`:o?`${n}${s}`:void 0}({axis:t,height:f,moveX:c,moveY:d,position:o,showPx:i,width:m});return{label:_,resizeListener:l}}({axis:n,fadeTimeout:o,onResize:a,showPx:c,position:s});if(!i)return null;const f=w()("components-resize-tooltip",r);return(0,v.createElement)(CK,(0,Po.Z)({"aria-hidden":"true",className:f,ref:t},d),m,(0,v.createElement)(NK,{"aria-hidden":d["aria-hidden"],label:p,position:s,ref:l,zIndex:u}))}));var PK=LK;const AK="components-resizable-box__handle",DK="components-resizable-box__side-handle",RK="components-resizable-box__corner-handle",MK={top:w()(AK,DK,"components-resizable-box__handle-top"),right:w()(AK,DK,"components-resizable-box__handle-right"),bottom:w()(AK,DK,"components-resizable-box__handle-bottom"),left:w()(AK,DK,"components-resizable-box__handle-left"),topLeft:w()(AK,RK,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:w()(AK,RK,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:w()(AK,RK,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:w()(AK,RK,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},OK={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},ZK={top:OK,right:OK,bottom:OK,left:OK,topLeft:OK,topRight:OK,bottomRight:OK,bottomLeft:OK},FK=(0,v.forwardRef)((function(e,t){let{className:n,children:r,showHandle:o=!0,__experimentalShowTooltip:i=!1,__experimentalTooltipProps:l={},...a}=e;return(0,v.createElement)(kK.e,(0,Po.Z)({className:w()("components-resizable-box__container",o&&"has-show-handle",n),handleClasses:MK,handleStyles:ZK,ref:t},a),r,i&&(0,v.createElement)(PK,l))}));var jK=FK,zK=n(89307),HK=n(33918),VK=n(67025),WK=n(34342);const $K=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],UK="wp-embed";var GK=n(41779),qK=n.n(GK);const{name:KK}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},type:{type:"string",__experimentalRole:"content"},providerNameSlug:{type:"string",__experimentalRole:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,__experimentalRole:"content"},previewable:{type:"boolean",default:!0,__experimentalRole:"content"}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},YK=e=>{var t;return null===(t=be(KK))||void 0===t?void 0:t.find((t=>{let{patterns:n}=t;return function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((t=>e.match(t)))}(e,n)}))},XK=e=>e&&e.includes('class="wp-embedded-content"'),JK=e=>{if(!e)return e;const t=$K.reduce(((e,t)=>{let{className:n}=t;return e[n]=!1,e}),{"wp-has-aspect-ratio":!1});return qK()(e,t)};function QK(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return JK(t);const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const o=r.body.querySelector("iframe");if(o&&o.height&&o.width){const e=(o.width/o.height).toFixed(2);for(let n=0;n<$K.length;n++){const r=$K[n];if(e>=r.ratio)return e-r.ratio>.1?JK(t):qK()(JK(t),r.className,"wp-has-aspect-ratio")}}return t}fr()((function(e,t,n,r){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return{};const i={};let{type:l="rich"}=e;const{html:a,provider_name:s}=e,c=(0,U.kebabCase)((s||t).toLowerCase());return XK(a)&&(l=UK),(a||"photo"===l)&&(i.type=l,i.providerNameSlug=c),i.className=QK(a,n,r&&o),i}));const eY="none",tY="media",nY="attachment",rY="custom",oY=["image"];function iY(e){var t,n;let{temporaryURL:r,attributes:o,setAttributes:i,isSelected:l,insertBlocksAfter:a,onReplace:s,onSelectImage:c,onSelectURL:u,onUploadError:d,containerRef:p,context:m,clientId:f,isContentLocked:h}=e;const{url:g="",alt:b,caption:y,align:_,id:k,href:x,rel:w,linkClass:I,linkDestination:T,title:B,width:L,height:P,linkTarget:A,sizeSlug:D}=o,R=(0,v.useRef)(),M=(0,pd.Z)(y),[O,Z]=(0,v.useState)(!!y),{allowResize:F=!0}=m,{getBlock:z}=(0,E.Z)(ku),{image:H,multiImageSelection:V}=(0,E.Z)((e=>{const{getMedia:t}=e(C.h),{getMultiSelectedBlockClientIds:n,getBlockName:r}=e(ku),o=n();return{image:k&&l?t(k,{context:"view"}):null,multiImageSelection:o.length&&o.every((e=>"core/image"===r(e)))}}),[k,l,f]),{canInsertCover:W,imageEditing:$,imageSizes:G,maxWidth:q,mediaUpload:K}=(0,E.Z)((e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:r}=e(ku),o=t(f),i=n();return{imageEditing:i.imageEditing,imageSizes:i.imageSizes,maxWidth:i.maxWidth,mediaUpload:i.mediaUpload,canInsertCover:r("core/cover",o)}}),[f]),{replaceBlocks:Y,toggleSelection:X}=(0,S.Z)(ku),{createErrorNotice:J,createSuccessNotice:Q}=(0,S.Z)(Px.h),ee=(0,ch.Z)("medium"),te=["wide","full"].includes(_),[{loadedNaturalWidth:ne,loadedNaturalHeight:re},oe]=(0,v.useState)({}),[ie,le]=(0,v.useState)(!1),[ae,se]=(0,v.useState)(),ce=function(e,t){const[n,r]=(0,v.useState)();function o(){var t;r(null===(t=e.current)||void 0===t?void 0:t.clientWidth)}return(0,v.useEffect)(o,t),(0,v.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",o),()=>{t.removeEventListener("resize",o)}}),[]),n}(p,[_]),ue=F&&!h&&!(te&&ee),me=G.filter((e=>{var t,n,r;let{slug:o}=e;return null==H||null===(t=H.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(r=n[o])||void 0===r?void 0:r.source_url})).map((e=>{let{name:t,slug:n}=e;return{value:n,label:t}}));(0,v.useEffect)((()=>{aY(k,g)&&l&&!ae&&window.fetch(g).then((e=>e.blob())).then((e=>se(e))).catch((()=>{}))}),[k,g,l,ae]),(0,v.useEffect)((()=>{y&&!M&&Z(!0)}),[y,M]);const fe=(0,v.useCallback)((e=>{e&&!y&&e.focus()}),[y]),{naturalWidth:he,naturalHeight:ge}=(0,v.useMemo)((()=>{var e,t;return{naturalWidth:(null===(e=R.current)||void 0===e?void 0:e.naturalWidth)||ne||void 0,naturalHeight:(null===(t=R.current)||void 0===t?void 0:t.naturalHeight)||re||void 0}}),[ne,re,null===(t=R.current)||void 0===t?void 0:t.complete]);(0,v.useEffect)((()=>{l||(le(!1),y||Z(!1))}),[l,y]);const ve=k&&he&&ge&&$,ye=!V&&ve&&!ie,_e=(0,v.createElement)(v.Fragment,null,(0,v.createElement)(Ru,{group:"block"},!h&&(0,v.createElement)(rf,{value:_,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};i({...t,align:e})}}),!h&&(0,v.createElement)(Fo,{onClick:()=>{Z(!O),O&&y&&i({caption:void 0})},icon:HK.Z,isPressed:O,label:O?(0,N.__)("Remove caption"):(0,N.__)("Add caption")}),!V&&!ie&&(0,v.createElement)(IZ,{url:x||"",onChangeUrl:function(e){i(e)},linkDestination:T,mediaUrl:H&&H.source_url||g,mediaLink:H&&H.link,linkTarget:A,linkClass:I,rel:w}),ye&&(0,v.createElement)(Fo,{onClick:()=>le(!0),icon:VK.Z,label:(0,N.__)("Crop")}),ae&&(0,v.createElement)(Fo,{onClick:function(){K({filesList:[ae],onFileChange(e){let[t]=e;c(t),j(t.url)||(se(),Q((0,N.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:oY,onError(e){J(e,{type:"snackbar"})}})},icon:vO.Z,label:(0,N.__)("Upload external image")}),!V&&W&&(0,v.createElement)(Fo,{icon:WK.Z,label:(0,N.__)("Add text over image"),onClick:function(){Y(f,Pe(z(f),"core/cover"))}})),!V&&!ie&&(0,v.createElement)(Ru,{group:"other"},(0,v.createElement)(kO,{mediaId:k,mediaURL:g,allowedTypes:oY,accept:"image/*",onSelect:c,onSelectURL:u,onError:d})),(0,v.createElement)(nh,null,(0,v.createElement)(pf.Z,{title:(0,N.__)("Settings")},!V&&(0,v.createElement)(MG.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Alt text (alternative text)"),value:b,onChange:function(e){i({alt:e})},help:(0,v.createElement)(v.Fragment,null,(0,v.createElement)(df.Z,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,N.__)("Describe the purpose of the image")),(0,N.__)("Leave empty if the image is purely decorative."))}),(0,v.createElement)(fM,{onChangeImage:function(e){var t,n,r;const o=null==H||null===(t=H.media_details)||void 0===t||null===(n=t.sizes)||void 0===n||null===(r=n[e])||void 0===r?void 0:r.source_url;if(!o)return null;i({url:o,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>i(e),slug:D,width:L,height:P,imageSizeOptions:me,isResizable:ue,imageWidth:he,imageHeight:ge}))),(0,v.createElement)(nh,{group:"advanced"},(0,v.createElement)(uf.Z,{__nextHasNoMarginBottom:!0,label:(0,N.__)("Title attribute"),value:B||"",onChange:function(e){i({title:e})},help:(0,v.createElement)(v.Fragment,null,(0,N.__)("Describe the role of this image on the page."),(0,v.createElement)(df.Z,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},(0,N.__)("(Note: many devices and browsers do not display this text.)")))}))),xe=(0,zK.v)(g);let we;we=b||(xe?(0,N.sprintf)((0,N.__)("This image has an empty alt attribute; its file name is %s"),xe):(0,N.__)("This image has an empty alt attribute"));const Ce=_R(o),Ee=null===(n=o.className)||void 0===n?void 0:n.includes("is-style-rounded"),Se=!!Ce.className||!(0,U.isEmpty)(Ce.style);let Ie,Te,Ne=(0,v.createElement)(v.Fragment,null,(0,v.createElement)("img",{src:r||g,alt:we,onError:()=>function(){const e=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{preview:r,attributes:o={}}=e,{url:i,providerNameSlug:l,type:a,...s}=o;if(!i||!pe(KK))return;const c=YK(i),u="wordpress"===l||a===UK;if(!u&&c&&(c.attributes.providerNameSlug!==l||!l))return ke(KK,{url:i,...s,...c.attributes});const d=null===(t=be(KK))||void 0===t?void 0:t.find((e=>{let{name:t}=e;return"wordpress"===t}));return d&&r&&XK(r.html)&&!u?ke(KK,{url:i,...d.attributes,...n}):void 0}({attributes:{url:g}});void 0!==e&&s(e)}(),onLoad:e=>{var t,n;oe({loadedNaturalWidth:null===(t=e.target)||void 0===t?void 0:t.naturalWidth,loadedNaturalHeight:null===(n=e.target)||void 0===n?void 0:n.naturalHeight})},ref:R,className:Ce.className,style:Ce.style}),r&&(0,v.createElement)(zw.ZP,null));if(ce&&he&&ge){const e=he>ce,t=ge/he;Ie=e?ce:he,Te=e?ce*t:ge}if(ve&&ie)Ne=(0,v.createElement)(dM,{id:k,url:g,width:L,height:P,clientWidth:ce,naturalHeight:ge,naturalWidth:he,onSaveImage:e=>i(e),onFinishEditing:()=>{le(!1)},borderProps:Ee?void 0:Ce});else if(ue&&Ie){const e=L||Ie,t=P||Te,n=he/ge,r=he{X(!0),i({width:parseInt(e+l.width,10),height:parseInt(t+l.height,10)})},resizeRatio:"center"===_?2:1},Ne)}else Ne=(0,v.createElement)("div",{style:{width:L,height:P}},Ne);return(0,v.createElement)(v.Fragment,null,!r&&_e,Ne,O&&(!gZ.isEmpty(y)||l)&&(0,v.createElement)(gZ,{identifier:"caption",className:DF("caption"),ref:fe,tagName:"figcaption","aria-label":(0,N.__)("Image caption text"),placeholder:(0,N.__)("Add caption"),value:y,onChange:e=>i({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a(ke(de()))}))}const lY=e=>(0,v.createElement)(NR,{className:"block-editor-media-placeholder",withIllustration:!0,icon:gK.Z,label:(0,N.__)("Image"),instructions:(0,N.__)("Upload an image file, pick one from your media library, or add one with a URL.")},e),aY=(e,t)=>t&&!e&&!j(t);function sY(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:r}=n;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}const cY={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},uY={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:e=>{let{phrasingContentSchema:t}=e;return{figure:{require:["img"],children:{...cY,a:{attributes:["href","rel","target"],children:cY},figcaption:{children:t}}}}},transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,o=n?n[1]:void 0,i=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),l=i?Number(i[1]):void 0,a=e.querySelector("a"),s=a&&a.href?"custom":void 0,c=a&&a.href?a.href:void 0,u=a&&a.rel?a.rel:void 0,d=a&&a.className?a.className:void 0;return ke("core/image",Cr("core/image",e.outerHTML,{align:o,id:l,linkDestination:s,href:c,rel:u,linkClass:d,anchor:r}))}},{type:"files",isMatch(e){if(e.some((e=>0===e.type.indexOf("image/")))&&e.some((e=>0!==e.type.indexOf("image/")))){const{createErrorNotice:e}=(0,$.dispatch)(Px.h);e((0,N.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file",type:"snackbar"})}return e.every((e=>0===e.type.indexOf("image/")))},transform(e){const t=e.map((e=>ke("core/image",{url:Z(e)})));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,t){let{shortcode:n}=t;const{body:r}=document.implementation.createHTMLDocument("");r.innerHTML=n.content;let o=r.querySelector("img");for(;o&&o.parentNode&&o.parentNode!==r;)o=o.parentNode;return o&&o.parentNode.removeChild(o),r.innerHTML.trim()}},href:{shortcode:(e,t)=>{let{shortcode:n}=t;return sY(n.content,"href")}},rel:{shortcode:(e,t)=>{let{shortcode:n}=t;return sY(n.content,"rel")}},linkClass:{shortcode:(e,t)=>{let{shortcode:n}=t;return sY(n.content,"class")}},id:{type:"number",shortcode:e=>{let{named:{id:t}}=e;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:e=>{let{named:{align:t="alignnone"}}=e;return t.replace("align","")}}}}]};var dY=uY;const pY={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:2,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img, .components-placeholder",text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSelector:"img, .wp-block-image__crop-area",__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:mY}=pY,fY={icon:gK.Z,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,N.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":(0,N.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:dY,edit:function(e){let{attributes:t,setAttributes:n,isSelected:r,className:o,insertBlocksAfter:i,onReplace:l,context:a,clientId:s}=e;const{url:c="",alt:u,caption:d,align:p,id:m,width:f,height:h,sizeSlug:g}=t,[b,y]=(0,v.useState)(),_=(0,v.useRef)();(0,v.useEffect)((()=>{_.current=u}),[u]);const k=(0,v.useRef)();(0,v.useEffect)((()=>{k.current=d}),[d]);const x=(0,v.useRef)(),{imageDefaultSize:C,mediaUpload:I,isContentLocked:T}=(0,E.Z)((e=>{const{getSettings:t,__unstableGetContentLockingParent:n}=e(ku),r=t();return{imageDefaultSize:r.imageDefaultSize,mediaUpload:r.mediaUpload,isContentLocked:!!n(s)}}),[]),{createErrorNotice:B}=(0,S.Z)(Px.h);function L(e){B(e,{type:"snackbar"}),n({src:void 0,id:void 0,url:void 0}),y(void 0)}function P(e){var r,o,i,l,a,s;if(!e||!e.url)return void n({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(j(e.url))return void y(e.url);y();let u,d=((e,t)=>{var n,r,o,i,l;const a=Object.fromEntries(Object.entries(null!=e?e:{}).filter((e=>{let[t]=e;return["alt","id","link","caption"].includes(t)})));return a.url=(null==e||null===(n=e.sizes)||void 0===n||null===(r=n[t])||void 0===r?void 0:r.url)||(null==e||null===(o=e.media_details)||void 0===o||null===(i=o.sizes)||void 0===i||null===(l=i[t])||void 0===l?void 0:l.source_url)||e.url,a})(e,C);if(k.current&&!d.caption){const{caption:e,...t}=d;d=t}var p,f,h,g,v,b,_;u=e.id&&e.id===m?{url:c}:{width:void 0,height:void 0,sizeSlug:(p=e,f=C,"url"in(null!==(h=null==p||null===(g=p.sizes)||void 0===g?void 0:g[f])&&void 0!==h?h:{})||"source_url"in(null!==(v=null==p||null===(b=p.media_details)||void 0===b||null===(_=b.sizes)||void 0===_?void 0:_[f])&&void 0!==v?v:{})?C:"full")};let x,w=t.linkDestination;if(!w)switch((null===(r=window)||void 0===r||null===(o=r.wp)||void 0===o||null===(i=o.media)||void 0===i||null===(l=i.view)||void 0===l||null===(a=l.settings)||void 0===a||null===(s=a.defaultProps)||void 0===s?void 0:s.link)||eY){case"file":case tY:w=tY;break;case"post":case nY:w=nY;break;case rY:w=rY;break;case eY:w=eY}switch(w){case tY:x=e.url;break;case nY:x=e.link}d.href=x,n({...d,...u,linkDestination:w})}function A(e){e!==c&&n({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:C})}let D=((e,t)=>!e&&j(t))(m,c);(0,v.useEffect)((()=>{if(!D)return;const e=function(e){return O[e]}(c);e&&I({filesList:[e],onFileChange:e=>{let[t]=e;P(t)},allowedTypes:oY,onError:e=>{D=!1,L(e)}})}),[]),(0,v.useEffect)((()=>{D?y(c):F(b)}),[D,c]);const R=aY(m,c)?c:void 0,M=!!c&&(0,v.createElement)("img",{alt:(0,N.__)("Edit image"),title:(0,N.__)("Edit image"),className:"edit-image-preview",src:c}),Z=_R(t),z=Ky({ref:x,className:w()(o,{"is-transient":b,"is-resized":!!f||!!h,[`size-${g}`]:g,"has-custom-border":!!Z.className||!(0,U.isEmpty)(Z.style)})});return(0,v.createElement)("figure",z,(b||c)&&(0,v.createElement)(iY,{temporaryURL:b,attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:i,onReplace:l,onSelectImage:P,onSelectURL:A,onUploadError:L,containerRef:x,context:a,clientId:s,isContentLocked:T}),!c&&!T&&(0,v.createElement)(Ru,{group:"block"},(0,v.createElement)(rf,{value:p,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}})),(0,v.createElement)(BO,{icon:(0,v.createElement)(k_,{icon:gK.Z}),onSelect:P,onSelectURL:A,onError:L,placeholder:lY,accept:"image/*",allowedTypes:oY,value:{id:m,src:R},mediaPreview:M,disableMediaButtons:b||c}))},save:function(e){let{attributes:t}=e;const{url:n,alt:r,caption:o,align:i,href:l,rel:a,linkClass:s,width:c,height:u,id:d,linkTarget:p,sizeSlug:m,title:f}=t,h=(0,U.isEmpty)(a)?void 0:a,g=yR(t),b=w()({[`align${i}`]:i,[`size-${m}`]:m,"is-resized":c||u,"has-custom-border":!!g.className||!(0,U.isEmpty)(g.style)}),y=w()(g.className,{[`wp-image-${d}`]:!!d}),_=(0,v.createElement)("img",{src:n,alt:r,className:y||void 0,style:g.style,width:c,height:u,title:f}),k=(0,v.createElement)(v.Fragment,null,l?(0,v.createElement)("a",{className:s,href:l,target:p,rel:h},_):_,!gZ.isEmpty(o)&&(0,v.createElement)(gZ.Content,{className:DF("caption"),tagName:"figcaption",value:o}));return(0,v.createElement)("figure",Ky.save({className:b}),k)},deprecated:_K},hY="core/image",gY={name:hY,examples:null,deprecated:null,save:()=>null},vY={...pY,...fY,...gY,category:"design",supports:{...pY.supports,html:!1,anchor:!1}},bY=e=>{const t=sG(e);if(!t[e.type])return null;const n=ez(t[e.type].name,e);return ae(n,t[e.type].settings),n},yY=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map((e=>e.message)),t=t.join(", ")),t},_Y=(e,t)=>e.map((e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:_Y(e.innerBlocks,t)}:n})),kY={async SAVE_FORM(){if((0,$.select)(WF).getIsFormSaving())return;if((0,$.dispatch)(WF).saveFormStarted(),(0,$.select)(WF).getFormErrors().length)return;const e=(0,$.select)(WF).getFormData(),t=(0,$.select)(WF).getFormBlocks(),n=(0,$.select)(WF).getAllAvailableCustomFields(),r=YF($F,Uo.colors,Uo.gradients,n),o={...XF(e),body:r(t),editor_version:2};await OF.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:o}).done((e=>{(0,$.dispatch)(WF).saveFormDone(e.data.id),Yj.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})})).fail((e=>{(0,$.dispatch)(WF).saveFormFailed(yY(e))}))},async SAVE_CUSTOM_FIELD(e){(0,$.dispatch)(WF).saveCustomFieldStarted();const t=(0,$.select)(WF).getAllAvailableCustomFields().find((t=>t.id===e.customFieldId)),n={};(0,U.merge)(n,t,e.data),await OF.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((n=>{(0,$.dispatch)(WF).saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()})).then((()=>{(0,$.dispatch)(WF).saveForm()})).fail((e=>{(0,$.dispatch)(WF).saveCustomFieldFailed(yY(e))}))},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,$.select)(WF).getIsCustomFieldCreating()||((0,$.dispatch)(WF).createCustomFieldStarted(e.data),(0,$.select)(WF).getIsCustomFieldCreating()&&await OF.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((e=>{const n=e.data;OF.x.trackEvent("Forms > Add new custom field",{"Field type":n.type});const r=ke(bY(n));(0,$.dispatch)(ku).replaceBlock(t,r),(0,$.dispatch)(WF).createCustomFieldDone(e.data)})).fail((e=>{(0,$.dispatch)(WF).createCustomFieldFailed(yY(e))})))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,$.dispatch)(WF).deleteCustomFieldStarted();const r=(0,$.select)(WF).getAllAvailableCustomFields().find((e=>e.id===t)),o=sG(r);await OF.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then((()=>{OF.x.trackEvent("Forms > Delete custom field",{"Field type":r.type}),(0,$.dispatch)(WF).deleteCustomFieldDone(t,n);const e=ez(o[r.type].name,r);pe(e)&&function(e){const t=(0,$.select)(Xt).getBlockType(e);if(t)return(0,$.dispatch)(Xt).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}(e),(0,$.dispatch)(ku).removeBlock(n)})).fail((e=>{(0,$.dispatch)(WF).deleteCustomFieldFailed(yY(e))}))},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,$.select)(WF).getFormBlocks(),n=_Y(t,(t=>{const n={...t};return["mailpoet-form/last-name-input","mailpoet-form/first-name-input","mailpoet-form/email-input"].includes(t.name)||t.name.startsWith("mailpoet-form/custom-text")?{...n,attributes:{...n.attributes,styles:e.styles}}:n}));(0,$.dispatch)(ku).resetBlocks(n)},async TUTORIAL_DISMISS(){await OF.x.Ajax.post({api_version:OF.x.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=Mj(t,"mailpoet-form/email-input"),r=Mj(t,"mailpoet-form/submit-button");if(n&&r)return void(0,$.dispatch)(WF).changeFormBlocks(t);const o=(0,$.select)(WF).getFormBlocks(),i=[...t];if(!n){let e=Mj(o,"mailpoet-form/email-input");e||(e=ke("mailpoet-form/email-input")),i.unshift(e)}if(!r){let e=Mj(o,"mailpoet-form/submit-button");e||(e=ke("mailpoet-form/submit-button")),i.push(e)}(0,$.dispatch)(ku).resetBlocks(i)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:Xj.t,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,$.select)(WF).getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}},xY={width:{unit:"percent",value:100}},wY={formDelay:15,formCookieExpiration:7},CY={styles:{width:{unit:"pixel",value:560}},...wY,animation:"slideup"},EY={styles:{width:{unit:"percent",value:100}},position:"top",...wY,animation:"slideup"},SY={width:{unit:"percent",value:100}},IY={styles:{width:{unit:"pixel",value:560}},position:"right",...wY,animation:"slideup"},TY={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"};function NY(e){var t,n,r,o,i,l,a,s,c,u,d,p,m,f,h,g,v,b,y,_,k,x,w,C,E,S,I,T,N,B,L,P,A,D,R,M,O,Z,F,j,z,H,V,W,$,U,G,q,K,Y,X,J,Q,ee,te,ne,re,oe,ie,le,ae,se,ce,ue,de,pe,me,fe,he,ge,ve,be,ye,_e,ke,xe,we,Ce,Ee,Se,Ie,Te,Ne,Be,Le,Pe,Ae,De,Re,Me,Oe,Ze,Fe,je,ze,He,Ve,We,$e,Ue,Ge,qe,Ke,Ye,Xe,Je,Qe,et,tt,nt,rt,ot,it,lt,at,st,ct,ut,dt,pt,mt,ft,ht,gt,vt,bt,yt,_t,kt,xt,wt,Ct,Et,St,It,Tt,Nt,Bt,Lt,Pt,At,Dt,Rt,Mt;const Ot={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===(null===(t=e.settings.form_placement)||void 0===t||null===(n=t.popup)||void 0===n?void 0:n.enabled),exitIntentEnabled:"1"===(null===(r=e.settings.form_placement)||void 0===r||null===(o=r.popup)||void 0===o?void 0:o.exit_intent_enabled),delay:void 0!==(null===(i=e.settings.form_placement)||void 0===i||null===(l=i.popup)||void 0===l?void 0:l.delay)?GU(null===(a=e.settings.form_placement)||void 0===a||null===(s=a.popup)||void 0===s?void 0:s.delay):CY.formDelay,cookieExpiration:void 0!==(null===(c=e.settings.form_placement)||void 0===c||null===(u=c.popup)||void 0===u?void 0:u.cookieExpiration)?GU(null===(d=e.settings.form_placement)||void 0===d||null===(p=d.popup)||void 0===p?void 0:p.cookieExpiration):CY.formCookieExpiration,animation:void 0!==(null===(m=e.settings.form_placement)||void 0===m||null===(f=m.popup)||void 0===f?void 0:f.animation)?null===(h=e.settings.form_placement)||void 0===h||null===(g=h.popup)||void 0===g?void 0:g.animation:CY.animation,styles:{...CY.styles,...null===(v=e.settings.form_placement)||void 0===v||null===(b=v.popup)||void 0===b?void 0:b.styles},categories:(null===(y=e.settings.form_placement)||void 0===y||null===(_=y.popup)||void 0===_?void 0:_.categories)??[],tags:(null===(k=e.settings.form_placement)||void 0===k||null===(x=k.popup)||void 0===x?void 0:x.tags)??[],posts:{all:"1"===(null===(w=e.settings.form_placement)||void 0===w||null===(C=w.popup)||void 0===C||null===(E=C.posts)||void 0===E?void 0:E.all),selected:Array.isArray(null===(S=e.settings.form_placement)||void 0===S||null===(I=S.popup)||void 0===I||null===(T=I.posts)||void 0===T?void 0:T.selected)?null===(N=e.settings.form_placement)||void 0===N||null===(B=N.popup)||void 0===B||null===(L=B.posts)||void 0===L?void 0:L.selected:[]},pages:{all:"1"===(null===(P=e.settings.form_placement)||void 0===P||null===(A=P.popup)||void 0===A||null===(D=A.pages)||void 0===D?void 0:D.all),selected:Array.isArray(null===(R=e.settings.form_placement)||void 0===R||null===(M=R.popup)||void 0===M||null===(O=M.pages)||void 0===O?void 0:O.selected)?null===(Z=e.settings.form_placement)||void 0===Z||null===(F=Z.popup)||void 0===F||null===(j=F.pages)||void 0===j?void 0:j.selected:[]}},fixedBar:{enabled:"1"===(null===(z=e.settings.form_placement)||void 0===z||null===(H=z.fixed_bar)||void 0===H?void 0:H.enabled),delay:void 0!==(null===(V=e.settings.form_placement)||void 0===V||null===(W=V.fixed_bar)||void 0===W?void 0:W.delay)?GU(null===($=e.settings.form_placement)||void 0===$||null===(U=$.fixed_bar)||void 0===U?void 0:U.delay):EY.formDelay,cookieExpiration:void 0!==(null===(G=e.settings.form_placement)||void 0===G||null===(q=G.fixed_bar)||void 0===q?void 0:q.cookieExpiration)?GU(null===(K=e.settings.form_placement)||void 0===K||null===(Y=K.fixed_bar)||void 0===Y?void 0:Y.cookieExpiration):EY.formCookieExpiration,animation:(null===(X=e.settings.form_placement)||void 0===X||null===(J=X.fixed_bar)||void 0===J?void 0:J.animation)??EY.animation,styles:{...EY.styles,...null===(Q=e.settings.form_placement)||void 0===Q||null===(ee=Q.fixed_bar)||void 0===ee?void 0:ee.styles},position:(null===(te=e.settings.form_placement)||void 0===te||null===(ne=te.fixed_bar)||void 0===ne?void 0:ne.position)??EY.position,categories:(null===(re=e.settings.form_placement)||void 0===re||null===(oe=re.fixed_bar)||void 0===oe?void 0:oe.categories)??[],tags:(null===(ie=e.settings.form_placement)||void 0===ie||null===(le=ie.fixed_bar)||void 0===le?void 0:le.tags)??[],posts:{all:"1"===(null===(ae=e.settings.form_placement)||void 0===ae||null===(se=ae.fixed_bar)||void 0===se||null===(ce=se.posts)||void 0===ce?void 0:ce.all),selected:Array.isArray(null===(ue=e.settings.form_placement)||void 0===ue||null===(de=ue.fixed_bar)||void 0===de||null===(pe=de.posts)||void 0===pe?void 0:pe.selected)?null===(me=e.settings.form_placement)||void 0===me||null===(fe=me.fixed_bar)||void 0===fe||null===(he=fe.posts)||void 0===he?void 0:he.selected:[]},pages:{all:"1"===(null===(ge=e.settings.form_placement)||void 0===ge||null===(ve=ge.fixed_bar)||void 0===ve||null===(be=ve.pages)||void 0===be?void 0:be.all),selected:Array.isArray(null===(ye=e.settings.form_placement)||void 0===ye||null===(_e=ye.fixed_bar)||void 0===_e||null===(ke=_e.pages)||void 0===ke?void 0:ke.selected)?null===(xe=e.settings.form_placement)||void 0===xe||null===(we=xe.fixed_bar)||void 0===we||null===(Ce=we.pages)||void 0===Ce?void 0:Ce.selected:[]}},belowPosts:{enabled:"1"===(null===(Ee=e.settings.form_placement)||void 0===Ee||null===(Se=Ee.below_posts)||void 0===Se?void 0:Se.enabled),styles:{...xY,...null===(Ie=e.settings.form_placement)||void 0===Ie||null===(Te=Ie.below_posts)||void 0===Te?void 0:Te.styles},categories:(null===(Ne=e.settings.form_placement)||void 0===Ne||null===(Be=Ne.below_posts)||void 0===Be?void 0:Be.categories)??[],tags:(null===(Le=e.settings.form_placement)||void 0===Le||null===(Pe=Le.below_posts)||void 0===Pe?void 0:Pe.tags)??[],posts:{all:"1"===(null===(Ae=e.settings.form_placement)||void 0===Ae||null===(De=Ae.below_posts)||void 0===De||null===(Re=De.posts)||void 0===Re?void 0:Re.all),selected:Array.isArray(null===(Me=e.settings.form_placement)||void 0===Me||null===(Oe=Me.below_posts)||void 0===Oe||null===(Ze=Oe.posts)||void 0===Ze?void 0:Ze.selected)?null===(Fe=e.settings.form_placement)||void 0===Fe||null===(je=Fe.below_posts)||void 0===je||null===(ze=je.posts)||void 0===ze?void 0:ze.selected:[]},pages:{all:"1"===(null===(He=e.settings.form_placement)||void 0===He||null===(Ve=He.below_posts)||void 0===Ve||null===(We=Ve.pages)||void 0===We?void 0:We.all),selected:Array.isArray(null===($e=e.settings.form_placement)||void 0===$e||null===(Ue=$e.below_posts)||void 0===Ue||null===(Ge=Ue.pages)||void 0===Ge?void 0:Ge.selected)?null===(qe=e.settings.form_placement)||void 0===qe||null===(Ke=qe.below_posts)||void 0===Ke||null===(Ye=Ke.pages)||void 0===Ye?void 0:Ye.selected:[]}},slideIn:{enabled:"1"===(null===(Xe=e.settings.form_placement)||void 0===Xe||null===(Je=Xe.slide_in)||void 0===Je?void 0:Je.enabled),delay:void 0!==(null===(Qe=e.settings.form_placement)||void 0===Qe||null===(et=Qe.slide_in)||void 0===et?void 0:et.delay)?GU(null===(tt=e.settings.form_placement)||void 0===tt||null===(nt=tt.slide_in)||void 0===nt?void 0:nt.delay):IY.formDelay,cookieExpiration:void 0!==(null===(rt=e.settings.form_placement)||void 0===rt||null===(ot=rt.slide_in)||void 0===ot?void 0:ot.cookieExpiration)?GU(null===(it=e.settings.form_placement)||void 0===it||null===(lt=it.slide_in)||void 0===lt?void 0:lt.cookieExpiration):IY.formCookieExpiration,position:(null===(at=e.settings.form_placement)||void 0===at||null===(st=at.slide_in)||void 0===st?void 0:st.position)??IY.position,animation:(null===(ct=e.settings.form_placement)||void 0===ct||null===(ut=ct.slide_in)||void 0===ut?void 0:ut.animation)??IY.animation,styles:{...IY.styles,...null===(dt=e.settings.form_placement)||void 0===dt||null===(pt=dt.slide_in)||void 0===pt?void 0:pt.styles},categories:(null===(mt=e.settings.form_placement)||void 0===mt||null===(ft=mt.slide_in)||void 0===ft?void 0:ft.categories)??[],tags:(null===(ht=e.settings.form_placement)||void 0===ht||null===(gt=ht.slide_in)||void 0===gt?void 0:gt.tags)??[],posts:{all:"1"===(null===(vt=e.settings.form_placement)||void 0===vt||null===(bt=vt.slide_in)||void 0===bt||null===(yt=bt.posts)||void 0===yt?void 0:yt.all),selected:Array.isArray(null===(_t=e.settings.form_placement)||void 0===_t||null===(kt=_t.slide_in)||void 0===kt||null===(xt=kt.posts)||void 0===xt?void 0:xt.selected)?null===(wt=e.settings.form_placement)||void 0===wt||null===(Ct=wt.slide_in)||void 0===Ct||null===(Et=Ct.posts)||void 0===Et?void 0:Et.selected:[]},pages:{all:"1"===(null===(St=e.settings.form_placement)||void 0===St||null===(It=St.slide_in)||void 0===It||null===(Tt=It.pages)||void 0===Tt?void 0:Tt.all),selected:Array.isArray(null===(Nt=e.settings.form_placement)||void 0===Nt||null===(Bt=Nt.slide_in)||void 0===Bt||null===(Lt=Bt.pages)||void 0===Lt?void 0:Lt.selected)?null===(Pt=e.settings.form_placement)||void 0===Pt||null===(At=Pt.slide_in)||void 0===At||null===(Dt=At.pages)||void 0===Dt?void 0:Dt.selected:[]}},others:{styles:{...SY,...null===(Rt=e.settings.form_placement)||void 0===Rt||null===(Mt=Rt.others)||void 0===Mt?void 0:Mt.styles}}},alignment:e.settings.alignment??TY.alignment,borderRadius:void 0!==e.settings.border_radius?GU(e.settings.border_radius):TY.borderRadius,borderSize:void 0!==e.settings.border_size?GU(e.settings.border_size):TY.borderSize,formPadding:void 0!==e.settings.form_padding?GU(e.settings.form_padding):TY.formPadding,inputPadding:void 0!==e.settings.input_padding?GU(e.settings.input_padding):TY.inputPadding,borderColor:e.settings.border_color,fontFamily:e.settings.font_family,fontSize:e.settings.fontSize,successValidationColor:e.settings.success_validation_color,errorValidationColor:e.settings.error_validation_color,backgroundImageUrl:e.settings.background_image_url,backgroundImageDisplay:e.settings.background_image_display,closeButton:e.settings.close_button??TY.closeButton}};return Ot.settings.formPlacement.belowPosts.styles.width.value=GU(Ot.settings.formPlacement.belowPosts.styles.width.value),Ot.settings.formPlacement.slideIn.styles.width.value=GU(Ot.settings.formPlacement.slideIn.styles.width.value),Ot.settings.formPlacement.fixedBar.styles.width.value=GU(Ot.settings.formPlacement.fixedBar.styles.width.value),Ot.settings.formPlacement.popup.styles.width.value=GU(Ot.settings.formPlacement.popup.styles.width.value),Ot.settings.formPlacement.others.styles.width.value=GU(Ot.settings.formPlacement.others.styles.width.value),delete Ot.settings.border_radius,delete Ot.settings.border_size,delete Ot.settings.border_color,delete Ot.settings.input_padding,delete Ot.settings.form_padding,delete Ot.settings.close_button,delete Ot.settings.font_family,delete Ot.settings.background_image_display,delete Ot.settings.background_image_url,Ot}function BY(e){const t=(0,E.Z)((e=>e(WF).hasEditorUndo()),[]),{historyUndo:n}=(0,S.Z)(WF),{registerShortcut:r}=(0,S.Z)("core/keyboard-shortcuts");return(0,K_.bx)("mailpoet-form-editor/undo",(e=>{n(),e.preventDefault()})),(0,v.useEffect)((()=>{r({name:"mailpoet-form-editor/undo",category:"block",description:(0,N.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})}),[r]),(0,zF.jsx)(Mo.ZP,{...e,icon:VF.Z,label:(0,N.__)("Undo"),shortcut:Al.displayShortcut.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var LY=n(42128);function PY(e){const t=(0,E.Z)((e=>e(WF).hasEditorRedo()),[]),{historyRedo:n}=(0,S.Z)(WF),{registerShortcut:r}=(0,S.Z)("core/keyboard-shortcuts"),o=()=>{n()};return(0,K_.bx)("mailpoet-form-editor/redo",(e=>{o(),e.preventDefault()})),(0,v.useEffect)((()=>{r({name:"mailpoet-form-editor/redo",category:"block",description:(0,N.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[r]),(0,zF.jsx)(Mo.ZP,{...e,icon:LY.Z,label:(0,N.__)("Redo"),shortcut:Al.displayShortcut.primaryShift("z"),"aria-disabled":!t,onClick:t?o:void 0,className:"editor-history__redo"})}function AY(e){let{isInserterOpened:t,setIsInserterOpened:n}=e;const r=(0,E.Z)((e=>e(WF).getSidebarOpened()),[]),o=(0,E.Z)((e=>e(WF).getIsFormSaving()),[]),i=(0,E.Z)((e=>e(WF).getIsPreviewShown()),[]),l=(0,E.Z)((e=>e(WF).isFullscreenEnabled()),[]),{toggleSidebar:a,saveForm:s,showPreview:c,toggleFullscreen:u}=(0,S.Z)(WF);return(0,zF.jsxs)("div",{className:"edit-post-header",children:[(0,zF.jsxs)("div",{className:"edit-post-header__settings",children:[(0,zF.jsx)(Mo.ZP,{isSecondary:!0,onClick:c,isPressed:i,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,N.__)("Preview")}),(0,zF.jsx)(Mo.ZP,{isPrimary:!0,className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:o,onClick:s,children:o?`${(0,N.__)("Saving")}`:(0,N.__)("Save")}),(0,zF.jsx)(Mo.ZP,{icon:"admin-generic",label:OF.x.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>a(!r),isPressed:r,className:"mailpoet-editor-header-button"}),(0,zF.jsx)(zo.Z,{icon:Nf.Z,label:(0,N.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,zF.jsx)(Ou.Z,{label:(0,N._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,zF.jsx)(HF,{shortcut:"Ctrl+Shift+Alt+F",label:(0,N.__)("Fullscreen mode"),info:(0,N.__)("Work without distraction"),isActive:l,onToggle:()=>u(!l)})})})]}),(0,zF.jsx)("div",{className:"edit-post-header__toolbar",children:(0,zF.jsxs)("div",{className:"toolbar edit-post-header-toolbar edit-post-header-toolbar__left",children:[(0,zF.jsx)(Mo.ZP,{isSecondary:!0,href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:OF.x.I18n.t("back")}),(0,zF.jsx)(Oo.Z,{as:Mo.ZP,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:t,onClick:()=>n(!t),icon:Tf.Z,label:(0,N._x)("Add block","Generic label for block inserter button")}),(0,zF.jsx)(BY,{"data-automation-id":"form_undo_button"}),(0,zF.jsx)(PY,{"data-automation-id":"form_redo_button"})]})})]})}AY.propTypes={isInserterOpened:jF().bool.isRequired,setIsInserterOpened:jF().func.isRequired},AY.displayName="FormEditorHeader";var DY=n(69156),RY=n(49029);function MY(){const e=(0,E.Z)((e=>e(WF).getTutorialUrl()),[]),t=(0,E.Z)((e=>e(WF).getTutorialSeen()),[]),{tutorialDismissed:n}=(0,S.Z)(WF),r=(0,v.useCallback)((()=>{n()}),[n]);return t?null:(0,zF.jsx)(DY.u,{isDismissible:!0,onRequestClose:r,children:(0,zF.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,zF.jsx)(RY.X,{level:2,children:OF.x.I18n.t("tutorialHeading")}),(0,zF.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var OY=n(40077),ZY=n(26138),FY=n(65311),jY=n.n(FY),zY=n(35614);n(1201);class HY extends v.Component{constructor(e){super(e),(0,ZY.Z)(this,"getFieldId",(e=>{const t=e||this.props;return t.field.id||t.field.name})),(0,ZY.Z)(this,"getSelectedValues",(()=>{if(void 0!==this.props.field.selected)return this.props.field.selected(this.props.item);if(void 0!==this.props.item&&void 0!==this.props.field.name){if(!this.allowMultipleValues())return this.props.item[this.props.field.name];if(zY.ZP.isArray(this.props.item[this.props.field.name]))return this.props.item[this.props.field.name].map((e=>e.id))}return null})),(0,ZY.Z)(this,"getItems",(()=>{let e;return void 0!==window[`mailpoet_${this.props.field.endpoint}`]?e=window[`mailpoet_${this.props.field.endpoint}`]:void 0!==this.props.field.values&&(e=this.props.field.values),zY.ZP.isArray(e)&&void 0!==this.props.field.filter&&(e=e.filter(this.props.field.filter)),e})),(0,ZY.Z)(this,"getLabel",(e=>void 0!==this.props.field.getLabel?this.props.field.getLabel(e,this.props.item):e.name)),(0,ZY.Z)(this,"getSearchLabel",(e=>void 0!==this.props.field.getSearchLabel?this.props.field.getSearchLabel(e,this.props.item):null)),(0,ZY.Z)(this,"getValue",(e=>void 0!==this.props.field.getValue?this.props.field.getValue(e,this.props.item):e.id)),(0,ZY.Z)(this,"setupSelect2",(()=>{if(this.isSelect2Initialized())return;let e={disabled:this.props.disabled||!1,width:this.props.width||"",placeholder:{id:"",text:this.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}};this.props.dropDownParent&&(e.dropdownParent=jY()(this.props.dropDownParent));const t=this.props.field.remoteQuery||null;t&&(e=Object.assign(e,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:t.endpoint,method:t.method,data:Object.assign(t.data,{query:e.term})}},processResults:function(e){let t;return t=zY.ZP.has(e,"data")?e.data.map((e=>({id:e.id||e.value,text:e.name||e.text}))):[],{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==this.props.field.extendSelect2Options&&(e=Object.assign(e,this.props.field.extendSelect2Options));const n=jY()(`#${this.selectRef.current.id}`).select2(e);let r=!1;n.on("select2:unselecting",(()=>{r=!0})),n.on("select2:opening",(e=>{!0===r&&(r=!1,e.preventDefault())})),n.on("change",this.handleChange)})),(0,ZY.Z)(this,"resetSelect2",(()=>{this.destroySelect2(),this.setupSelect2()})),(0,ZY.Z)(this,"destroySelect2",(()=>{this.isSelect2Initialized()&&(jY()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())})),(0,ZY.Z)(this,"cleanupAfterSelect2",(()=>{jY()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),jY()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")})),(0,ZY.Z)(this,"allowMultipleValues",(()=>!0===this.props.field.multiple)),(0,ZY.Z)(this,"isSelect2Initialized",(()=>!0===jY()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible"))),(0,ZY.Z)(this,"isSelect2Component",(()=>this.allowMultipleValues()||this.props.field.forceSelect2)),(0,ZY.Z)(this,"handleChange",(e=>{if(void 0===this.props.onValueChange)return;const t=jY()(`#${this.selectRef.current.id}`).children(":selected").map((function(){return{id:jY()(this).val(),text:jY()(this).text()}})),n=this.props.field.multiple?zY.ZP.pluck(t,"id"):zY.ZP.pluck(t,"id").toString(),r=this.transformChangedValue(n,t);this.props.onValueChange({target:{value:r,name:this.props.field.name,id:e.target.id}})})),(0,ZY.Z)(this,"transformChangedValue",((e,t)=>"function"==typeof this.props.field.transformChangedValue?this.props.field.transformChangedValue.call(this,e,t):e)),(0,ZY.Z)(this,"insertEmptyOption",(()=>{if(!this.allowMultipleValues())return this.props.field.placeholder?(0,zF.jsx)("option",{className:"default"}):void 0})),this.selectRef=(0,v.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&jY()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==this.props.item&&void 0!==e.item&&this.allowMultipleValues()&&zY.ZP.isArray(this.props.item[this.props.field.name])&&!zY.ZP.isEqual(this.props.item[this.props.field.name],e.item[this.props.field.name])&&jY()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}componentWillUnmount(){this.isSelect2Component()&&this.destroySelect2()}render(){const e=this.getItems(this.props.field),t=this.getSelectedValues(),n=e.map((e=>{const t=this.getLabel(e),n=this.getSearchLabel(e),r=this.getValue(e);return(0,zF.jsx)("option",{className:"default",value:r,title:n,children:t},`option-${e.id}`)}));return(0,zF.jsxs)("select",{id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:t,...this.props.field.validation,children:[this.insertEmptyOption(),n]})}}HY.propTypes={onValueChange:jF().func,field:jF().shape({name:jF().string.isRequired,values:jF().oneOfType([jF().object,jF().array]),getLabel:jF().func,resetSelect2OnUpdate:jF().bool,selected:jF().func,endpoint:jF().string,filter:jF().func,getSearchLabel:jF().func,getValue:jF().func,placeholder:jF().string,remoteQuery:jF().object,extendSelect2Options:jF().object,multiple:jF().bool,forceSelect2:jF().bool,transformChangedValue:jF().func,disabled:jF().bool,validation:jF().shape({"data-parsley-required":jF().bool,"data-parsley-required-message":jF().string,"data-parsley-type":jF().string,"data-parsley-errors-container":jF().string,maxLength:jF().number})}).isRequired,item:jF().object,disabled:jF().bool,width:jF().string,dropDownParent:jF().string},HY.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0,dropDownParent:void 0},HY.displayName="FormEditorSelection";const VY=(0,MF.withBoundary)(HY);function WY(){const[e,t]=(0,v.useState)(!1),n=(0,E.Z)((e=>e(WF).getFormName()),[]),r=w()({"is-selected":e}),{changeFormName:o}=(0,S.Z)(WF);return(0,zF.jsxs)("div",{className:r,children:[(0,zF.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:OF.x.I18n.t("addFormName")}),(0,zF.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:OF.x.I18n.t("addFormName"),"data-automation-id":"form_title_input",type:"text",onKeyPress:()=>t(!1),onBlur:()=>t(!1),onChange:e=>o(e.target.value),value:n})]})}function $Y(e){let{onToggle:t,isOpened:n}=e;const r=(0,E.Z)((e=>e(WF).getFormSettings()),[]),o=(0,E.Z)((e=>e(WF).getAllAvailableSegments()),[]),i=(0,E.Z)((e=>e(WF).getAllAvailablePages()),[]),l=(0,E.Z)((e=>e(WF).getNotice("missing-lists")),[]),a=(0,E.Z)((e=>e(WF).isFormEnabled()),[]),{changeFormSettings:s,toggleForm:c}=(0,S.Z)(WF),u=r.segments?o.filter((e=>r.segments.includes(e.id.toString()))):[],d=l&&!u.length;return(0,zF.jsx)(oz.Z,{children:(0,zF.jsxs)(pf.Z,{title:OF.x.I18n.t("formSettings"),opened:n,onToggle:t,children:[(0,zF.jsx)(WY,{}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("displayForm"),checked:a,onChange:c}),(0,zF.jsxs)(Xu.ZP,{label:OF.x.I18n.t("settingsListLabel"),className:w()({"mailpoet-form-missing-lists":d}),children:[d?(0,zF.jsx)("span",{className:"mailpoet-form-lists-error",children:OF.x.I18n.t("settingsPleaseSelectList")}):null,(0,zF.jsx)(VY,{item:{segments:u},onValueChange:e=>{(0,U.isEqual)(r.segments,e.target.value)||s({...r,segments:e.target.value})},field:{id:"segments",name:"segments",values:o,multiple:!0,placeholder:OF.x.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,zF.jsx)(OY.Z,{className:"mailpoet-form-inline-radios__control",onChange:e=>{s({...r,on_success:e})},selected:r.on_success||"message",label:OF.x.I18n.t("settingsAfterSubmit"),options:[{label:OF.x.I18n.t("settingsShowMessage"),value:"message"},{label:OF.x.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===r.on_success?(0,zF.jsx)(BT.Z,{value:r.success_page,options:i.map((e=>({value:e.id.toString(),label:e.title}))),onChange:e=>{s({...r,success_page:e})}}):(0,zF.jsx)(MG.Z,{value:r.success_message,onChange:e=>{s({...r,success_message:e})},rows:3})]})})}function UY(e){let{name:t,imageUrl:n,onImageUrlChange:r,imageDisplay:o,onImageDisplayChange:i}=e;return(0,zF.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,zF.jsx)(Xu.ZP.VisualLabel,{children:t}),(0,zF.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,zF.jsx)("input",{type:"text",value:n??"",onChange:e=>r(e.target.value)}),(0,zF.jsx)(tC,{onSelect:e=>r(e.url),allowedTypes:["image"],render:e=>{let{open:t}=e;return(0,zF.jsx)(Mo.ZP,{isSecondary:!0,isSmall:!0,onClick:t,children:OF.x.I18n.t("formSettingsStylesSelectImage")})}})]}),(0,zF.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,zF.jsx)(BT.Z,{value:o,options:[{label:OF.x.I18n.t("imagePlacementScale"),value:"scale"},{label:OF.x.I18n.t("imagePlacementFit"),value:"fit"},{label:OF.x.I18n.t("imagePlacementTile"),value:"tile"}],onChange:i})})]})}$Y.propTypes={onToggle:jF().func.isRequired,isOpened:jF().bool.isRequired},$Y.displayName="FormEditorBasicSettingsPanel";const GY=(0,zF.jsx)(tp.Wj,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,zF.jsx)(tp.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,zF.jsx)(tp.G,{id:"icons/ic_settings",children:(0,zF.jsx)(tp.y$,{d:"M8.05,0 L8.05101528,2.11065231 C8.65254335,2.23933489 9.2139617,2.47621094 9.71391655,2.7999267 L11.2072853,1.30779041 L12.6922096,2.79271465 L11.199432,4.28509331 C11.5234762,4.78529701 11.7605802,5.34705952 11.8893477,5.94898472 L14,5.95 L14,8.05 L11.8895604,8.05002048 C11.7608414,8.65232154 11.5236547,9.21442744 11.199432,9.71490669 L12.6922096,11.2072853 L11.2072853,12.6922096 L9.71391655,11.2000733 C9.2139617,11.5237891 8.65254335,11.7606651 8.05101528,11.8893477 L8.05,14 L5.95,14 L5.94898472,11.8893477 C5.34705952,11.7605802 4.78529701,11.5234762 4.28509331,11.199432 L2.79271465,12.6922096 L1.30779041,11.2072853 L2.7999267,9.71391655 C2.4760325,9.21368611 2.23907376,8.65192438 2.11043961,8.05002048 L8.8817842e-16,8.05 L1.01676633e-15,5.95 L2.11065231,5.94898472 C2.23933489,5.34745665 2.47621094,4.7860383 2.7999267,4.28608345 L1.30779041,2.79271465 L2.79271465,1.30779041 L4.28509331,2.80056797 C4.78529701,2.47652376 5.34705952,2.23941984 5.94898472,2.11065231 L5.95,0 L8.05,0 Z M7,4 C5.34314575,4 4,5.34314575 4,7 C4,8.65685425 5.34314575,10 7,10 C8.65685425,10 10,8.65685425 10,7 C10,5.34314575 8.65685425,4 7,4 Z",id:"ic_settings"})})})}),qY=(0,zF.jsx)(tp.Wj,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,zF.jsx)(tp.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,zF.jsx)(tp.y$,{d:"M12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 Z M15.5939818,8.20494484 C15.1497095,7.86124495 14.5235958,7.95992422 14.1955177,8.42535116 L14.1955177,8.42535116 L11.2218999,12.6438652 L9.73479332,10.9561217 C9.36019283,10.530981 8.72753928,10.5044698 8.32172209,10.8969074 C7.91590488,11.289345 7.89059874,11.9521231 8.26519924,12.3772638 L8.26519924,12.3772638 L10.5728715,14.9962817 C10.9986562,15.4795122 11.7391892,15.4370557 12.1120948,14.9080343 L12.1120948,14.9080343 L15.8043703,9.66999857 C16.1324484,9.20457165 16.0382543,8.54864475 15.5939818,8.20494484 Z",id:"Combined-Shape",fill:"#ff5301",fillRule:"nonzero"})})});function KY(e){let{label:t,active:n,canBeActive:r,onClick:o,children:i,className:l,automationId:a,displaySettingsIcon:s}=e;const[c,u]=(0,v.useState)(!1);return(0,zF.jsxs)("div",{"data-automation-id":a,className:w()(l,"selection-item",{"selection-item-active":n&&r}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:o,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),o())},role:"button",tabIndex:0,children:[(0,zF.jsxs)("div",{className:"selection-item-body",children:[(0,zF.jsxs)("div",{className:"selection-item-settings",children:[s?(0,zF.jsx)("div",{className:w()("selection-item-icon",{"selection-item-icon-hover":c}),children:GY}):(0,zF.jsx)("div",{}),c&&!n&&r&&(0,zF.jsx)("div",{className:"selection-item-settings-oval"}),n&&r&&(0,zF.jsx)("div",{className:"selection-item-check",children:qY})]}),i]}),c&&(0,zF.jsx)("div",{className:"selection-item-overlay"})]},t)}function YY(e){let{label:t,active:n,onClick:r,iconUrl:o}=e;return(0,zF.jsx)(KY,{label:t,onClick:r,active:n,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,zF.jsx)("img",{src:o,alt:t.replace("_"," "),className:"close-button-selection-item-icon"})})}function XY(e){let{name:t,value:n,onChange:r}=e;const o=(0,E.Z)((e=>e(WF).getCloseIconsUrl()),[]);return(0,zF.jsxs)("div",{children:[(0,zF.jsx)(Xu.ZP.VisualLabel,{children:t}),(0,zF.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,zF.jsx)(YY,{label:"round_white",active:"round_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>r("round_white")}),(0,zF.jsx)(YY,{label:"round_black",active:"round_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>r("round_black")}),(0,zF.jsx)(YY,{label:"square_white",active:"square_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>r("square_white")}),(0,zF.jsx)(YY,{label:"square_black",active:"square_black"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>r("square_black")}),(0,zF.jsx)(YY,{label:"classic",active:"classic"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>r("classic")}),(0,zF.jsx)(YY,{label:"classic_white",active:"classic_white"===n,iconUrl:o.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>r("classic_white")})]})]})}function JY(e){let{onToggle:t,isOpened:n}=e;const{changeFormSettings:r}=(0,S.Z)(WF),o=(0,E.Z)((e=>e(WF).getFormSettings()),[]),i=(0,v.useRef)(o);(0,v.useEffect)((()=>{i.current=o}),[o]);const l=(e,t)=>{const n={...i.current};n[e]=t??TY[e]??void 0,r(n),i.current=n};return(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formSettingsStyles"),opened:n,onToggle:t,children:(0,zF.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,zF.jsx)(Tz,{title:OF.x.I18n.t("formSettingsColor"),settings:[{label:OF.x.I18n.t("formSettingsStylesBackground"),colorValue:o.backgroundColor,gradientValue:o.gradient,onColorChange:(0,U.partial)(l,"backgroundColor"),onGradientChange:(0,U.partial)(l,"gradient")},{label:OF.x.I18n.t("formSettingsStylesFont"),colorValue:o.fontColor,onColorChange:(0,U.partial)(l,"fontColor")},{label:OF.x.I18n.t("formSettingsBorder"),colorValue:o.borderColor,onColorChange:(0,U.partial)(l,"borderColor")}]}),(0,zF.jsx)(UY,{name:OF.x.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:o.backgroundImageUrl,onImageUrlChange:(0,U.partial)(l,"backgroundImageUrl"),imageDisplay:o.backgroundImageDisplay,onImageDisplayChange:(0,U.partial)(l,"backgroundImageDisplay")}),(0,zF.jsx)(fG,{value:o.fontSize,onChange:(0,U.partial)(l,"fontSize")}),(0,zF.jsx)(gG,{name:OF.x.I18n.t("formSettingsStylesFontFamily"),value:o.fontFamily,onChange:(0,U.partial)(l,"fontFamily")}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsInputPadding"),value:o.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,U.partial)(l,"inputPadding")}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderSize"),value:void 0!==o.borderSize?o.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,U.partial)(l,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsBorderRadius"),value:void 0!==o.borderRadius?o.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,U.partial)(l,"borderRadius")}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formSettingsAlignment"),onChange:(0,U.partial)(l,"alignment"),options:[{value:Lz.Left,label:OF.x.I18n.t("formSettingsAlignmentLeft")},{value:Lz.Center,label:OF.x.I18n.t("formSettingsAlignmentCenter")},{value:Lz.Right,label:OF.x.I18n.t("formSettingsAlignmentRight")}],value:o.alignment}),(0,zF.jsx)(iN,{label:OF.x.I18n.t("formSettingsFormPadding"),value:o.formPadding,min:0,max:40,allowReset:!0,onChange:(0,U.partial)(l,"formPadding")}),(0,zF.jsx)(Tz,{title:OF.x.I18n.t("validationMessageColor"),settings:[{label:OF.x.I18n.t("successValidationColorTitle"),colorValue:o.successValidationColor,onColorChange:(0,U.partial)(l,"successValidationColor")},{label:OF.x.I18n.t("errorValidationColorTitle"),colorValue:o.errorValidationColor,onColorChange:(0,U.partial)(l,"errorValidationColor")}]}),(0,zF.jsx)(XY,{name:OF.x.I18n.t("closeButtonHeading"),value:o.closeButton,onChange:(0,U.partial)(l,"closeButton")})]})})})}KY.defaultProps={canBeActive:!0,displaySettingsIcon:!0,className:void 0,automationId:void 0};const QY=(0,zF.jsxs)(tp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,zF.jsxs)("defs",{children:[(0,zF.jsx)(tp.UL,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,zF.jsx)(tp.UL,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,zF.jsxs)(tp.G,{fill:"none",fillRule:"evenodd",children:[(0,zF.jsx)(tp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,zF.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,zF.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,zF.jsx)(tp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function eX(e){let{label:t,icon:n,active:r,canBeActive:o,onClick:i}=e;return(0,zF.jsxs)(KY,{label:t,onClick:i,active:r,canBeActive:o,className:"form-placement-option",automationId:`form-placement-option-${t}`,children:[(0,zF.jsx)("div",{className:"form-placement-option-icon",children:n}),(0,zF.jsx)("div",{className:"form-placement-option-label",children:(0,zF.jsx)("p",{children:t})})]})}function tX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{showPlacementSettings:t}=(0,S.Z)(WF);return(0,zF.jsx)(eX,{active:e.formPlacement.belowPosts.enabled,label:OF.x.I18n.t("placeFormBellowPages"),icon:QY,onClick:()=>{t("below_posts")},canBeActive:!0})}eX.defaultProps={canBeActive:!0};const nX=(0,zF.jsxs)(tp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,zF.jsxs)("defs",{children:[(0,zF.jsx)(tp.UL,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,zF.jsx)(tp.y$,{d:"M49 34h46a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4H49a4 4 0 0 1-4-4V38a4 4 0 0 1 4-4z",id:"popup_icon_c"}),(0,zF.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,zF.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,zF.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,zF.jsx)("feColorMatrix",{values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0",in:"shadowBlurOuter1"})]})]}),(0,zF.jsxs)(tp.G,{fill:"none",fillRule:"evenodd",children:[(0,zF.jsx)(tp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,zF.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,zF.jsxs)(tp.G,{fillRule:"nonzero",children:[(0,zF.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,zF.jsx)(tp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function rX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{showPlacementSettings:t}=(0,S.Z)(WF);return(0,zF.jsx)(eX,{active:e.formPlacement.popup.enabled,label:OF.x.I18n.t("placePopupFormOnPages"),icon:nX,onClick:()=>{t("popup")},canBeActive:!0})}const oX=(0,zF.jsxs)(tp.Wj,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,zF.jsx)("defs",{children:(0,zF.jsx)(tp.UL,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,zF.jsxs)(tp.G,{fill:"none",fillRule:"evenodd",children:[(0,zF.jsx)(tp.y$,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,zF.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,zF.jsx)(tp.UL,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function iX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{showPlacementSettings:t}=(0,S.Z)(WF);return(0,zF.jsx)(eX,{active:e.formPlacement.fixedBar.enabled,label:OF.x.I18n.t("placeFixedBarFormOnPages"),icon:oX,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const lX=(0,zF.jsxs)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"76",height:"63",viewBox:"0 0 76 63",children:[(0,zF.jsxs)("defs",{children:[(0,zF.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,zF.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,zF.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,zF.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,zF.jsxs)("feMerge",{children:[(0,zF.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,zF.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,zF.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,zF.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,zF.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,zF.jsx)("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"})]}),(0,zF.jsx)(tp.UL,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,zF.jsx)(tp.y$,{id:"slide_in_prefix__d",d:"M.525 0h27.45c.29 0 .525.235.525.525v22.05c0 .29-.235.525-.525.525H.525c-.29 0-.525-.235-.525-.525V.525C0 .235.235 0 .525 0z"})]}),(0,zF.jsxs)(tp.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,zF.jsx)(tp.y$,{fill:"#FFF",fillRule:"nonzero",d:"M2.1 0h71.8c1.16 0 2.1.94 2.1 2.1v58.8c0 1.16-.94 2.1-2.1 2.1H2.1C.94 63 0 62.06 0 60.9V2.1C0 .94.94 0 2.1 0z"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,zF.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,zF.jsxs)(tp.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,zF.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,zF.jsx)(tp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,zF.jsx)(tp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,zF.jsx)(tp.UL,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function aX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{showPlacementSettings:t}=(0,S.Z)(WF);return(0,zF.jsx)(eX,{active:e.formPlacement.slideIn.enabled,label:OF.x.I18n.t("placeSlideInFormOnPages"),icon:lX,onClick:()=>{t("slide_in")},canBeActive:!0})}const sX=(0,zF.jsxs)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,zF.jsxs)("defs",{children:[(0,zF.jsx)(tp.UL,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,zF.jsx)(tp.UL,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,zF.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,zF.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,zF.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,zF.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,zF.jsxs)("feMerge",{children:[(0,zF.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,zF.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,zF.jsxs)(tp.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,zF.jsx)(tp.y$,{fill:"#FFF",fillRule:"nonzero",d:"M4 0h136c2.21 0 4 1.79 4 4v112c0 2.21-1.79 4-4 4H4c-2.21 0-4-1.79-4-4V4c0-2.21 1.79-4 4-4z"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,zF.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,zF.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,zF.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,zF.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,zF.jsx)(tp.UL,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,zF.jsx)(tp.UL,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,zF.jsx)(tp.UL,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function cX(){const{showPlacementSettings:e}=(0,S.Z)(WF);return(0,zF.jsx)(eX,{active:!1,label:OF.x.I18n.t("formPlacementOtherLabel"),icon:sX,onClick:()=>{e("others")},canBeActive:!1})}function uX(e){let{onToggle:t,isOpened:n}=e;return(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("formPlacement"),opened:n,onToggle:t,className:"form-sidebar-form-placement-panel",children:(0,zF.jsxs)("div",{className:"form-placement-option-list",children:[(0,zF.jsx)(tX,{}),(0,zF.jsx)(iX,{}),(0,zF.jsx)(rX,{}),(0,zF.jsx)(aX,{}),(0,zF.jsx)(cX,{})]})})})}uX.propTypes={onToggle:jF().func.isRequired,isOpened:jF().bool.isRequired};var dX=n(70907),pX=n.n(dX);function mX(e){let{options:t,value:n,onChange:r}=e;const o=(0,v.useRef)(null),i=(0,v.useRef)(null),l=(0,v.useCallback)((e=>{r(e.getValue())}),[r]);return(0,v.useEffect)((()=>(i.current=pX().fromTextArea(o.current,t),i.current.on("change",l),()=>{i.current&&i.current.toTextArea()})),[t,l]),(0,v.useEffect)((()=>{i.current.getValue()!==n&&(i.current.off("change",l),i.current.setValue(n),i.current.on("change",l))}),[n,l]),(0,zF.jsx)("div",{children:(0,zF.jsx)("textarea",{ref:o,name:"name",defaultValue:n,autoComplete:"off"})})}function fX(e){let{onToggle:t,isOpened:n}=e;const r=(0,E.Z)((e=>e(WF).getFormStyles()),[]),{changeFormStyles:o}=(0,S.Z)(WF);return(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:OF.x.I18n.t("customCss"),opened:n,onToggle:t,children:(0,zF.jsx)(mX,{value:r,onChange:o})})})}n(25002),mX.propTypes={value:jF().string.isRequired,onChange:jF().func.isRequired,options:jF().shape({lineNumbers:jF().bool,tabMode:jF().string,matchBrackets:jF().bool,theme:jF().string,mode:jF().string})},mX.defaultProps={options:{lineNumbers:!0,tabMode:"indent",matchBrackets:!0,theme:"neo",mode:"css"}},fX.propTypes={onToggle:jF().func.isRequired,isOpened:jF().bool.isRequired};var hX=n(55741);function gX(e){let{onToggle:t,isOpened:n}=e;const r=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:o}=(0,S.Z)(WF),i=OF.x.tags.map((e=>e.name));return(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{title:"Tags",opened:n,onToggle:t,children:(0,zF.jsx)(hX.T,{label:OF.x.I18n.t("addNewTag"),onChange:e=>{(0,U.isEqual)(r.tags,e.value)||o({...r,tags:e.value})},suggestedValues:i,selectedValues:r.tags})})})}function vX(){const e=(0,S.Z)(WF).toggleSidebarPanel,t=(0,E.Z)((e=>e(WF).getSidebarOpenedPanels()),[]);return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)($Y,{isOpened:t.includes("basic-settings"),onToggle:(0,U.partial)(e,"basic-settings")})}),(0,zF.jsx)(JY,{isOpened:t.includes("styles-settings"),onToggle:(0,U.partial)(e,"styles-settings")}),(0,zF.jsx)(uX,{isOpened:t.includes("form-placement"),onToggle:(0,U.partial)(e,"form-placement")}),(0,zF.jsx)(gX,{isOpened:t.includes("tags"),onToggle:(0,U.partial)(e,"tags")}),(0,zF.jsx)(fX,{isOpened:t.includes("custom-css"),onToggle:(0,U.partial)(e,"custom-css")})]})}function bX(){return(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(xF,{})})}function yX(e){let{children:t,closeSidebar:n}=e;return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[(0,zF.jsx)("span",{className:"interface-complementary-area-header__small-title",children:OF.x.I18n.t("formSettings")}),(0,zF.jsx)(Mo.ZP,{onClick:n,icon:"no-alt"})]}),(0,zF.jsxs)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs",children:[t,(0,zF.jsx)(Mo.ZP,{onClick:n,icon:"no-alt"})]})]})}function _X(e){let{onClose:t}=e;const n=(0,E.Z)((e=>e(WF).getDefaultSidebarActiveTab()),[]),r=(0,E.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]),{switchDefaultSidebarTab:o}=(0,S.Z)(WF);return(0,v.useEffect)((()=>{o(r?"block":"form")}),[r,o]),(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(yX,{closeSidebar:t,children:(0,zF.jsxs)("ul",{children:[(0,zF.jsx)("li",{children:(0,zF.jsx)("button",{onClick:()=>{o("form")},className:w()("components-button edit-post-sidebar__panel-tab",{"is-active":"form"===n}),"data-automation-id":"mailpoet_form_settings_tab",type:"button",children:OF.x.I18n.t("form")})}),(0,zF.jsx)("li",{children:(0,zF.jsx)("button",{onClick:()=>{o("block")},className:w()("components-button edit-post-sidebar__panel-tab",{"is-active":"block"===n}),"data-automation-id":"mailpoet_block_settings_tab",type:"button",children:(0,N.__)("Block")})})]})}),"form"===n?(0,zF.jsx)(vX,{}):(0,zF.jsx)(bX,{})]})}var kX=n(30211);function xX(e){let{label:t,minPercents:n=0,maxPercents:r=100,minPixels:o=10,maxPixels:i=1e3,value:l,defaultPercentValue:a=50,defaultPixelValue:s=200,onChange:c}=e;const[u,d]=(0,v.useState)(l??{unit:"pixel",value:void 0});return(0,v.useEffect)((()=>{d(l)}),[l]),(0,zF.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,zF.jsx)(Xu.ZP.VisualLabel,{children:t}),(0,zF.jsx)(OY.Z,{className:"mailpoet-form-inline-radios__control",selected:u.unit||"pixel",options:[{label:"px",value:"pixel"},{label:"%",value:"percent"}],onChange:e=>{const t={value:"pixel"===e?s:a,unit:e};d(t),c(t)}}),(0,zF.jsx)(iN,{value:u.value??("pixel"===u.unit?s:a),min:"pixel"===u.unit?o:n,max:"pixel"===u.unit?i:r,onChange:e=>{const t={unit:"pixel"===u.unit?"pixel":"percent",value:e};d(t),c(t)}})]})}xX.displayName="FormEditorSizeSettings";const wX=(0,MF.withBoundary)(xX);function CX(e){let{settingsPlacementKey:t}=e;const n=(0,E.Z)((e=>e(WF).getFormSettings()),[]),r=(0,E.Z)((e=>(0,kX.sortBy)("name",e(WF).getAllWPTags().concat(e(WF).getAllWooCommerceTags()))),[]),o=(0,E.Z)((e=>(0,kX.sortBy)("name",e(WF).getAllWPCategories().concat(e(WF).getAllWooCommerceCategories()))),[]),i=(0,E.Z)((e=>e(WF).getAllWPPages()),[]),l=(0,E.Z)((e=>(0,kX.sortBy)("name",e(WF).getAllWPPosts().concat(e(WF).getAllWooCommerceProducts()))),[]),a=(0,E.Z)((e=>e(WF).getIsPreviewShown()),[]),{changeFormSettings:s}=(0,S.Z)(WF);let c="no-preview";return a&&(c="preview"),(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("placeFormOnAllPages"),checked:n.formPlacement[t].pages.all,onChange:e=>{(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.pages.all`,e),(0,kX.cond)([[()=>e,(0,kX.compose)([(0,kX.assocPath)(`formPlacement.${t}.pages.selected`,[]),(0,kX.assocPath)(`formPlacement.${t}.categories`,[]),(0,kX.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,kX.identity]])])(n)}}),(0,zF.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,zF.jsx)("div",{className:"form-editor-placement-selection",children:(0,zF.jsx)(VY,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].pages.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].pages.selected;(0,kX.isEqual)(r,e.target.value)||(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.pages.selected`,e.target.value),(0,kX.cond)([[()=>!!e.target.value.length,(0,kX.assocPath)(`formPlacement.${t}.pages.all`,!1)],[()=>!e.target.value.length,kX.identity]])])(n)},field:{id:`${c}pages`,name:"pages",values:i,multiple:!0,placeholder:OF.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].pages.selected}})})}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("placeFormOnAllPosts"),checked:n.formPlacement[t].posts.all,onChange:e=>{(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.posts.all`,e),(0,kX.cond)([[()=>e,(0,kX.compose)([(0,kX.assocPath)(`formPlacement.${t}.posts.selected`,[]),(0,kX.assocPath)(`formPlacement.${t}.categories`,[]),(0,kX.assocPath)(`formPlacement.${t}.tags`,[])])],[()=>!e,kX.identity]])])(n)}}),(0,zF.jsx)("div",{className:"form-editor-placement-selection",children:(0,zF.jsx)(VY,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].posts.selected.join()}`},onValueChange:e=>{const r=n.formPlacement[t].posts.selected;(0,kX.isEqual)(r,e.target.value)||(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.posts.selected`,e.target.value),(0,kX.cond)([[()=>!!e.target.value.length,(0,kX.assocPath)(`formPlacement.${t}.posts.all`,!1)],[()=>!e.target.value.length,kX.identity]])])(n)},field:{id:`${c}posts`,name:"posts",values:l,multiple:!0,placeholder:OF.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].posts.selected}})}),(0,zF.jsxs)("div",{children:[(0,zF.jsx)("p",{className:"form-editor-sidebar-heading",children:OF.x.I18n.t("displayOnCategories")}),(0,zF.jsx)("div",{className:"form-editor-placement-selection",children:(0,zF.jsx)(VY,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].categories.join()}`},onValueChange:e=>{const r=n.formPlacement[t].categories;(0,kX.isEqual)(r,e.target.value)||(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.categories`,e.target.value),(0,kX.cond)([[()=>!!e.target.value.length,(0,kX.compose)([(0,kX.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,kX.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,kX.identity]])])(n)},field:{id:`${c}categories`,name:"categories",values:o,multiple:!0,placeholder:OF.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].categories}})})]}),(0,zF.jsxs)("div",{children:[(0,zF.jsx)("p",{className:"form-editor-sidebar-heading",children:OF.x.I18n.t("displayOnTags")}),(0,zF.jsx)("div",{className:"form-editor-placement-selection",children:(0,zF.jsx)(VY,{dropDownParent:a?".mailpoet-modal-content":void 0,item:{id:`${c}${n.formPlacement[t].tags.join()}`},onValueChange:e=>{const r=n.formPlacement[t].tags;(0,kX.isEqual)(r,e.target.value)||(0,kX.compose)([s,(0,kX.assocPath)(`formPlacement.${t}.tags`,e.target.value),(0,kX.cond)([[()=>!!e.target.value.length,(0,kX.compose)([(0,kX.assocPath)(`formPlacement.${t}.pages.all`,!1),(0,kX.assocPath)(`formPlacement.${t}.posts.all`,!1)])],[()=>!e.target.value.length,kX.identity]])])(n)},field:{id:`${c}tags`,name:"tags",values:r,multiple:!0,placeholder:OF.x.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>n.formPlacement[t].tags}})})]})]})}CX.displayName="FormEditorPlacementSettings";const EX=(0,MF.withBoundary)(CX);function SX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:t}=(0,S.Z)(WF),n=e.formPlacement.belowPosts.enabled;return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:OF.x.I18n.t("placeFormBellowPagesDescription")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("enable"),checked:n,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.belowPosts.enabled",kX.__,e)])}),n&&(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(wX,{label:OF.x.I18n.t("formSettingsWidth"),value:e.formPlacement.belowPosts.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,kX.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,zF.jsx)(EX,{settingsPlacementKey:"belowPosts"})]})]})}function IX(e){let{settingsPlacementKey:t}=e;const n=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:r}=(0,S.Z)(WF);return(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("animationHeader"),value:n.formPlacement[t].animation,options:[{label:OF.x.I18n.t("animationNone"),value:"none"},{label:"Fade In",value:"fadein"},{label:"Slide Right",value:"slideright"},{label:"Slide Left",value:"slideleft"},{label:"Slide Up",value:"slideup"},{label:"Slide Down",value:"slidedown"},{label:"Zoom Out",value:"zoomout"},{label:"Zoom In",value:"zoomin"},{label:"Flip",value:"flip"}],onChange:(0,kX.compose)([r,(0,kX.assocPath)(`formPlacement.${t}.animation`,kX.__,n)])})}IX.displayName="FormEditorAnimationSettings";const TX=(0,MF.withBoundary)(IX);function NX(e){let{settingsPlacementKey:t}=e;const n=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:r}=(0,S.Z)(WF);return(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formPlacementCookieExpiration"),value:n.formPlacement[t].cookieExpiration,options:[{value:"0",label:OF.x.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:OF.x.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map((e=>({value:`${e}`,label:OF.x.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())})))],onChange:(0,kX.compose)([r,(0,kX.assocPath)(`formPlacement.${t}.cookieExpiration`,kX.__,n)])})}NX.displayName="FormEditorCookieSettings";const BX=(0,MF.withBoundary)(NX),LX=[0,2,5,10,15,30,45,60,120,180,240];function PX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:t}=(0,S.Z)(WF),n=e.formPlacement.popup.enabled;return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:OF.x.I18n.t("placePopupFormOnPagesDescription")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("enable"),checked:n,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.popup.enabled",kX.__,e)])}),n&&(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("hr",{}),(0,zF.jsx)(wX,{label:OF.x.I18n.t("formSettingsWidth"),value:e.formPlacement.popup.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,kX.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,zF.jsx)(EX,{settingsPlacementKey:"popup"}),(0,zF.jsx)(TX,{settingsPlacementKey:"popup"}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.popup.delay",kX.__,e)]),options:LX.map((e=>({value:`${e}`,label:OF.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,zF.jsx)(BX,{settingsPlacementKey:"popup"}),(0,zF.jsxs)("div",{children:[(0,zF.jsx)("p",{children:(0,zF.jsx)("b",{children:OF.x.I18n.t("exitIntentTitle")})}),(0,zF.jsx)("p",{children:OF.x.I18n.t("exitIntentDescription")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.popup.exitIntentEnabled",kX.__,e)])})]})]})]})}var AX=n(34352),DX=n.n(AX);function RX(){const[e,t]=(0,v.useState)(null),n=(0,E.Z)((e=>e(WF).getFormExports()),[]),r=(0,E.Z)((e=>e(WF).getFormSettings()),[]),o=(0,E.Z)((e=>e(WF).isFormSaved()),[]),{changeFormSettings:i}=(0,S.Z)(WF),l=DX()(OF.x.I18n.t("addFormWidgetHint"),/\[link](.*?)\[\/link]/g,(e=>(0,zF.jsx)("a",{href:"widgets.php",target:"_blank",children:e},"addFormWidgetHintLink"))),a=DX()(OF.x.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,(e=>(0,zF.jsx)("code",{children:n.shortcode},e))),s=(0,U.curry)(((e,r)=>(r.preventDefault(),OF.x.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe)))),c=DX()(OF.x.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,(e=>"PHP"===e?(0,zF.jsx)("a",{href:"#",onClick:s("php"),children:e},"exportPHP"):(0,zF.jsx)("a",{href:"#",onClick:s("iframe"),children:e},"exportIframe")));return o?(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:l}),(0,zF.jsx)("p",{children:a}),(0,zF.jsx)("p",{children:c}),e?(0,zF.jsx)(MG.Z,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,zF.jsx)("hr",{}),(0,zF.jsx)(wX,{label:OF.x.I18n.t("formSettingsWidth"),value:r.formPlacement.others.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:200,defaultPercentValue:100,onChange:e=>{i((0,kX.assocPath)("formPlacement.others.styles.width",e,r))}})]}):(0,zF.jsx)("p",{children:OF.x.I18n.t("saveFormFirst")})}RX.displayName="FormEditorOtherSettings";const MX=[0,2,5,10,15,30,45,60,120,180,240];function OX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:t}=(0,S.Z)(WF),n=e.formPlacement.fixedBar.enabled;return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:OF.x.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("enable"),checked:n,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.fixedBar.enabled",kX.__,e)])}),n&&(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("hr",{}),(0,zF.jsx)(OY.Z,{label:OF.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:OF.x.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:OF.x.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.fixedBar.position",kX.__,e)])}),(0,zF.jsx)(wX,{label:OF.x.I18n.t("formSettingsWidth"),value:e.formPlacement.fixedBar.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,kX.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,zF.jsx)(EX,{settingsPlacementKey:"fixedBar"}),(0,zF.jsx)(TX,{settingsPlacementKey:"fixedBar"}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.fixedBar.delay",kX.__,e)]),options:MX.map((e=>({value:`${e}`,label:OF.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,zF.jsx)(BX,{settingsPlacementKey:"fixedBar"})]})]})}OX.displayName="FormEditorFixedBarSettings";const ZX=[0,2,5,10,15,30,45,60,120,180,240];function FX(){const e=(0,E.Z)((e=>e(WF).getFormSettings()),[]),{changeFormSettings:t}=(0,S.Z)(WF),n=e.formPlacement.slideIn.enabled;return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("p",{children:OF.x.I18n.t("placeSlideInFormOnPagesDescription")}),(0,zF.jsx)(jd.Z,{label:OF.x.I18n.t("enable"),checked:n,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.slideIn.enabled",kX.__,e)])}),n&&(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)("hr",{}),(0,zF.jsx)(OY.Z,{label:OF.x.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:OF.x.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:OF.x.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.slideIn.position",kX.__,e)])}),(0,zF.jsx)(wX,{label:OF.x.I18n.t("formSettingsWidth"),value:e.formPlacement.slideIn.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,kX.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,zF.jsx)(EX,{settingsPlacementKey:"slideIn"}),(0,zF.jsx)(TX,{settingsPlacementKey:"slideIn"}),(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,kX.compose)([t,(0,kX.assocPath)("formPlacement.slideIn.delay",kX.__,e)]),options:ZX.map((e=>({value:`${e}`,label:OF.x.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,zF.jsx)(BX,{settingsPlacementKey:"slideIn"})]})]})}function jX(e){let{activePanel:t}=e;return(0,zF.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===t&&(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(RX,{})}),"below_posts"===t&&(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(SX,{})}),"fixed_bar"===t&&(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(OX,{})}),"popup"===t&&(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(PX,{})}),"slide_in"===t&&(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(FX,{})})]})}function zX(e){let{onClose:t}=e;const n=(0,E.Z)((e=>e(WF).getPreviewSettings()),[]);return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(yX,{closeSidebar:t,children:(0,zF.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===n.formType&&OF.x.I18n.t("placeFormOthers"),"below_posts"===n.formType&&OF.x.I18n.t("placeFormBellowPages"),"fixed_bar"===n.formType&&OF.x.I18n.t("placeFixedBarFormOnPages"),"popup"===n.formType&&OF.x.I18n.t("placePopupFormOnPages"),"slide_in"===n.formType&&OF.x.I18n.t("placeSlideInFormOnPages")]})}),(0,zF.jsx)(oz.Z,{children:(0,zF.jsx)(pf.Z,{children:(0,zF.jsx)(jX,{activePanel:n.formType})})})]})}function HX(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,S.Z)(WF),n=(0,E.Z)((e=>e(WF).getActiveSidebar()),[]),r=(0,E.Z)((e=>e("core/block-editor").getSelectedBlockClientId()),[]);return(0,v.useEffect)((()=>{r&&t("default")}),[r,t]),(0,zF.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,zF.jsx)(_X,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,zF.jsx)(zX,{onClose:()=>{t("default")}})]})}function VX(e){let{setIsInserterOpened:t}=e;const n=(0,E.Z)((e=>e(WF).getInserterPanelInsertPoint()),[]);return(0,zF.jsxs)("div",{className:"edit-post-editor__inserter-panel",children:[(0,zF.jsx)("div",{className:"edit-post-editor__inserter-panel-header",children:(0,zF.jsx)(Mo.ZP,{icon:_Z.Z,onClick:()=>t(!1)})}),(0,zF.jsx)("div",{className:"edit-post-editor__inserter-panel-content",children:(0,zF.jsx)(IF,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:n.rootClientId??void 0,__experimentalInsertionIndex:n.insertionIndex??void 0})})]})}HX.displayName="FormEditorSidebar";var WX=n(76761);function $X(){const e=(0,E.Z)((e=>e(WF).getDismissibleNotices()),[]),t=(0,E.Z)((e=>e(WF).getNonDismissibleNotices()),[]),{removeNotice:n}=(0,S.Z)(WF),r=(0,U.memoize)((e=>{setTimeout((()=>n(e)),5e3)}));return e.forEach((e=>r(e.id))),(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(WX.Z,{notices:t,className:"components-editor-notices__pinned"}),(0,zF.jsx)(WX.Z,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}$X.displayName="FormEditorNotices";var UX=n(35572);const GX=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,E.Z)((e=>e(WF).getFormStyles()),[]);try{UX.parse(t)}catch(t){return b.createPortal(null,e)}const n=Tk([{css:t}],".editor-styles-wrapper");return b.createPortal(n[0],e)};function qX(){return(0,zF.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"16px",height:"24px",viewBox:"0 0 16 24",version:"1.1",children:(0,zF.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,zF.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,zF.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,zF.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,zF.jsx)("path",{d:"M16,3 C16,1.34314575 14.6568542,0 13,0 L3,0 C1.34314575,0 0,1.34314575 0,3 L0,21 C0,22.6568542 1.34314575,24 3,24 L13,24 C14.6568542,24 16,22.6568542 16,21 L16,3 Z M14,5.5 L14,17.5 C14,18.0522847 13.5522847,18.5 13,18.5 L3,18.5 C2.44771525,18.5 2,18.0522847 2,17.5 L2,5.5 C2,4.94771525 2.44771525,4.5 3,4.5 L13,4.5 C13.5522847,4.5 14,4.94771525 14,5.5 Z M7,21 C7,20.4477153 7.44771525,20 8,20 C8.55228475,20 9,20.4477153 9,21 C9,21.5522847 8.55228475,22 8,22 C7.44771525,22 7,21.5522847 7,21 Z",id:"Shape"})})})})})})}function KX(){return(0,zF.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:(0,zF.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,zF.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,zF.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,zF.jsx)("g",{children:(0,zF.jsx)("path",{d:"M13.965,20.5 C14.1138804,20.5 14.2550143,20.5663566 14.35,20.681 L14.35,20.681 L16.449,23.213 C16.5561084,23.3657981 16.5692196,23.5655248 16.4830056,23.7310137 C16.3967915,23.8965027 16.2255996,24.0002137 16.039,24 L16.039,24 L7.96,24 C7.7734004,24.0002137 7.60220849,23.8965027 7.51599443,23.7310137 C7.42978036,23.5655248 7.44289164,23.3657981 7.55,23.213 L7.55,23.213 L9.65,20.681 C9.74498572,20.5663566 9.88611956,20.5 10.035,20.5 L10.035,20.5 Z M22.5,-4.08562073e-14 C23.3284271,-4.08562073e-14 24,0.671572875 24,1.5 L24,1.5 L24,17.5 C24,18.3284271 23.3284271,19 22.5,19 L22.5,19 L1.5,19 C0.671572875,19 0,18.3284271 0,17.5 L0,17.5 L0,1.5 C0,0.671572875 0.671572875,-4.08562073e-14 1.5,-4.08562073e-14 L1.5,-4.08562073e-14 Z M21.5,2 L2.5,2 C2.22385763,2 2,2.22385763 2,2.5 L2,2.5 L2,14.5 C2,14.7761424 2.22385763,15 2.5,15 L2.5,15 L21.5,15 C21.7761424,15 22,14.7761424 22,14.5 L22,14.5 L22,2.5 C22,2.22385763 21.7761424,2 21.5,2 L21.5,2 Z"})})})})})})}function YX(e){let{children:t,onDisplayTypeChange:n,selectedDisplayType:r}=e;const[o,i]=(0,v.useState)(r),l=e=>{i(e),n(e)};return(0,zF.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,zF.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,zF.jsx)("a",{className:w()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===o}),onClick:e=>{e.preventDefault(),l("desktop")},title:(0,N._x)("Desktop","Desktop browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_desktop",children:(0,zF.jsx)(KX,{})}),(0,zF.jsx)("a",{className:w()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===o}),onClick:e=>{e.preventDefault(),l("mobile")},title:(0,N._x)("Mobile","Mobile browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_mobile",children:(0,zF.jsx)(qX,{})})]}),(0,zF.jsx)("div",{className:w()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==o},{mailpoet_browser_preview_container_desktop:"desktop"===o}),children:(0,zF.jsx)("div",{className:"mailpoet_browser_preview_border",children:t})}),"desktop"!==o&&(0,zF.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:(0,N.__)("Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.","mailpoet")})]})}function XX(){const e=(0,v.useRef)(null),[t,n]=(0,v.useState)(!1),{hidePreview:r,changePreviewSettings:o}=(0,S.Z)(WF),i=(0,E.Z)((e=>e(WF).getIsPreviewShown()),[]),l=(0,E.Z)((e=>e(WF).getIsPreviewReady()),[]),a=(0,E.Z)((e=>e(WF).getPreviewSettings()),[]),s=(0,E.Z)((e=>e(WF).getFormSettings()),[]),c=(0,E.Z)((e=>e(WF).getFormData().id),[]),u=(0,E.Z)((e=>e(WF).getEditorUrl()),[]),d=(0,E.Z)((e=>e(WF).getPreviewPageUrl()),[]);(0,v.useEffect)((()=>{n(!1);const e=document.getElementById("beacon-container");i&&e&&(e.style.display="none")}),[i]),(0,v.useEffect)((()=>{if(!e.current||!t)return;const n={formType:a.formType,formSettings:s};e.current.contentWindow.postMessage(n,d)}),[s,e,a,t,d]);const p=(0,v.useCallback)((()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),r()}),[r]),m=(0,v.useCallback)((e=>{n(!1),o({...a,formType:e})}),[o,a]),f=(0,v.useCallback)((e=>{o({...a,displayType:e})}),[o,a]);if(!i)return null;const h={id:c,form_type:a.formType,editor_url:u};let g=`${d}&data=${btoa(JSON.stringify(h))}`;return["below_posts"].includes(a.formType)&&(g+=`#mailpoet_form_preview_${c}`),(0,zF.jsxs)(DY.u,{onRequestClose:p,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",overlayClassName:"mailpoet_form_preview_modal_overlay",children:[!l&&(0,zF.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,zF.jsx)(zw.ZP,{})}),l&&(0,zF.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,zF.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,zF.jsx)(BT.Z,{label:OF.x.I18n.t("formPlacementLabel"),value:a.formType,onChange:m,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:OF.x.I18n.t("placeFormOthers")},{value:"below_posts",label:OF.x.I18n.t("placeFormBellowPages")},{value:"fixed_bar",label:OF.x.I18n.t("placeFixedBarFormOnPages")},{value:"popup",label:OF.x.I18n.t("placePopupFormOnPages")},{value:"slide_in",label:OF.x.I18n.t("placeSlideInFormOnPages")}]}),(0,zF.jsx)(jX,{activePanel:a.formType})]}),(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsxs)(YX,{onDisplayTypeChange:f,selectedDisplayType:a.displayType,children:[!t&&(0,zF.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,zF.jsx)(zw.ZP,{})}),(0,zF.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:g,title:OF.x.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===a.formType?"no":"yes"}),"others"===a.formType&&"desktop"===a.displayType&&(0,zF.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:OF.x.I18n.t("formPreviewOthersDisclaimer")})]})})]})]})}function JX(e){let{children:t}=e;const{fontColor:n,backgroundColor:r,gradient:o,fontSize:i,borderRadius:l,borderSize:a,borderColor:s,alignment:c,formPadding:u,backgroundImageUrl:d,backgroundImageDisplay:p,fontFamily:m}=(0,E.Z)((e=>e(WF).getFormSettings()),[]),f=(0,E.Z)((e=>e(WF).getPreviewSettings()),[]),h=(0,E.Z)((e=>e(WF).getFormWidth(f.formType)),[f.formType]);let g,v,b,y;a&&s&&(g="solid"),l&&(v=Number(l)),u&&(b=Number(u)),c&&(y=c);const _=[],k={color:n,fontSize:`${i}${Number.isNaN(Number(`${i}`||NaN))?"":"px"}`,fontFamily:m,lineHeight:1.2,borderRadius:v,borderWidth:a,borderColor:s,borderStyle:g,textAlign:y,padding:b,width:"pixel"===h.unit?h.value:`${h.value}%`,margin:"0 auto",maxWidth:"100%"};if(["others","below_posts"].includes(f.formType)&&"percent"===h.unit&&(k.maxWidth=600),void 0!==d&&d){let e="center",t="no-repeat",n="cover";"fit"===p&&(n="auto",e="center top"),"tile"===p&&(t="repeat",n="auto"),_.push(`url(${d}) ${e}/${n} ${t}`)}if(o&&_.push(o),r&&_.push(r),_.length&&(k.background=_.join(", ")),"fixed_bar"===f.formType){const e={width:k.width,margin:"0 auto"};return k.width="max-content",k.minWidth="100%",k.maxWidth="auto",(0,zF.jsx)("div",{className:"mailpoet-form-background",style:k,children:(0,zF.jsx)("div",{style:e,children:t})})}return(0,zF.jsx)("div",{className:"mailpoet-form-background",style:k,children:t})}function QX(){const e=(0,E.Z)((e=>e(WF).isFullscreenEnabled()),[]);return(0,v.useEffect)((()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}),[e]),null}function eJ(){const e=(0,E.Z)((e=>e(WF).getSidebarOpened()),[]),t=(0,E.Z)((e=>e(WF).isInserterOpened()),[]),n=(0,E.Z)((e=>e(WF).getFormBlocks()),[]),r=(0,E.Z)((e=>e("core").canUser("create","media")),[]),o=(0,E.Z)((e=>e("core/block-editor").getSelectedBlock()),[]),i=w()("edit-post-layout interface-interface-skeleton",o?o.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:l,toggleInserter:a}=(0,S.Z)(WF),s={mediaUpload:r?H:null,supportsLayout:!1,maxWidth:580,fontSizes:$F,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,enableCustomUnits:!0,__experimentalFetchLinkSuggestions:ZF,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:a,__experimentalFeatures:{color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:Uo.colors},gradients:{default:Uo.gradients}}}};return(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(vG,{}),(0,zF.jsx)(K_.vn,{children:(0,zF.jsx)(I.zt,{children:(0,zF.jsxs)("div",{className:i,children:[(0,zF.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,zF.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(AY,{isInserterOpened:t,setIsInserterOpened:a})})}),(0,zF.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,zF.jsxs)(B_,{value:n,onInput:l,onChange:l,settings:s,useSubRegistry:!1,children:[t&&(0,zF.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,zF.jsx)(VX,{setIsInserterOpened:a})}),(0,zF.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)($X,{})}),(0,zF.jsx)(RF.D,{storeName:"mailpoet-form-editor"}),(0,zF.jsx)(Z_,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,zF.jsxs)(EF,{children:[(0,zF.jsx)(NF,{}),(0,zF.jsx)(NF.Register,{}),(0,zF.jsx)("div",{className:"mailpoet_form",children:(0,zF.jsx)(ok,{children:(0,zF.jsx)(PF,{children:(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(JX,{children:(0,zF.jsx)(WI,{})})})})})})]})})]}),e&&(0,zF.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(HX,{})})})]})}),(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(GX,{})}),(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(QX,{})})]}),(0,zF.jsx)(T.Z.Slot,{})]})})}),(0,zF.jsx)(MF.ErrorBoundary,{children:(0,zF.jsx)(XX,{})}),(0,zF.jsx)(MY,{})]})}GX.displayName="FormStyles",YX.propTypes={children:jF().node.isRequired,onDisplayTypeChange:jF().func,selectedDisplayType:jF().string},YX.defaultProps={onDisplayTypeChange:()=>{},selectedDisplayType:"desktop"},YX.displayName="FormEditorPreview",XX.displayName="FormPreviewWrapper",JX.propTypes={children:jF().node.isRequired},JX.displayName="FormStylingBackground",QX.displayName="Fullscreen";const tJ=(0,hh.Z)((0,mh.Z)(((e,t)=>{if(he(t.name,"multiple",!0))return{};const n=e(ku).getBlocks().find((e=>{let{name:n}=e;return t.name===n}));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,fh.Z)(((e,t)=>{let{originalBlockClientId:n}=t;return{selectFirst:()=>e(ku).selectBlock(n)}}))),nJ=(0,Ao.o)((e=>tJ((t=>{let{originalBlockClientId:n,selectFirst:r,...o}=t;if(!n)return(0,v.createElement)(e,o);const i=pe(o.name),l=function(e){const t=Ne(Be("to",e),(e=>{let{type:t,blocks:n}=e;return"block"===t&&1===n.length}));return t?pe(t.blocks[0]):null}(o.name);return[(0,v.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,v.createElement)(e,(0,Po.Z)({key:"block-edit"},o))),(0,v.createElement)(Ih,{key:"multiple-use-warning",actions:[(0,v.createElement)(Mo.ZP,{key:"find-original",variant:"secondary",onClick:r},(0,N.__)("Find original")),(0,v.createElement)(Mo.ZP,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,N.__)("Remove")),l&&(0,v.createElement)(Mo.ZP,{key:"transform",variant:"secondary",onClick:()=>o.onReplace(ke(l.name,o.attributes))},(0,N.__)("Transform into:")," ",l.title)]},(0,v.createElement)("strong",null,null==i?void 0:i.title,": "),(0,N.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,_e.KJ)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",nJ);var rJ=n(19451);const oJ="core/bold",iJ=(0,N.__)("Bold"),lJ={name:oJ,title:iJ,tagName:"strong",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r(hl(n,{type:oJ,title:iJ}))}return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"primary",character:"b",onUse:i}),(0,v.createElement)(bZ,{name:"bold",icon:rJ.Z,title:iJ,onClick:function(){r(hl(n,{type:oJ})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),(0,v.createElement)(yZ,{inputType:"formatBold",onInput:i}))}};var aJ=n(75209);const sJ="core/code",cJ=(0,N.__)("Inline code"),uJ={name:sJ,title:cJ,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n[t-1])return e;if(t-2<0)return e;const r=n.lastIndexOf("`",t-2);if(-1===r)return e;const o=r,i=t-2;return o===i?e:(e=Gi(e,o,o+1),e=xi(e=Gi(e,i,i+1),{type:sJ},o,i))},edit(e){let{value:t,onChange:n,onFocus:r,isActive:o}=e;function i(){n(hl(t,{type:sJ,title:cJ})),r()}return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"access",character:"x",onUse:i}),(0,v.createElement)(bZ,{icon:aJ.Z,title:cJ,onClick:i,isActive:o,role:"menuitemcheckbox"}))}},dJ=["image"],pJ="core/image",mJ=(0,N.__)("Inline image"),fJ={name:pJ,title:mJ,keywords:[(0,N.__)("photo"),(0,N.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function(e){let{value:t,onChange:n,onFocus:r,isObjectActive:o,activeObjectAttributes:i,contentRef:l}=e;const[a,s]=(0,v.useState)(!1);function c(){s(!1)}return(0,v.createElement)(eC,null,(0,v.createElement)(bZ,{icon:(0,v.createElement)(tp.Wj,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,v.createElement)(tp.y$,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:mJ,onClick:function(){s(!0)},isActive:o}),a&&(0,v.createElement)(tC,{allowedTypes:dJ,onSelect:e=>{let{id:o,url:i,alt:l,width:a}=e;c(),n(function(e,t,n,r){return Ui(e,{formats:[,],replacements:[t],text:Ei},void 0,void 0)}(t,{type:pJ,attributes:{className:`wp-image-${o}`,style:`width: ${Math.min(a,150)}px;`,url:i,alt:l}})),r()},onClose:c,render:e=>{let{open:t}=e;return t(),null}}),o&&(0,v.createElement)(hJ,{value:t,onChange:n,activeObjectAttributes:i,contentRef:l}))}};function hJ(e){let{value:t,onChange:n,activeObjectAttributes:r,contentRef:o}=e;const{style:i}=r,[l,a]=(0,v.useState)(null==i?void 0:i.replace(/\D/g,"")),s=gl({editableContentElement:o.current,value:t,settings:fJ});return(0,v.createElement)(T.Z,{placement:"bottom",focusOnMount:!1,anchor:s,className:"block-editor-format-toolbar__image-popover"},(0,v.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:e=>{const o=t.replacements.slice();o[t.start]={type:pJ,attributes:{...r,style:l?`width: ${l}px;`:""}},n({...t,replacements:o}),e.preventDefault()}},(0,v.createElement)(Bf.Z,{alignment:"bottom",spacing:"0"},(0,v.createElement)(Gp.Z,{className:"block-editor-format-toolbar__image-container-value",label:(0,N.__)("Width"),value:l,min:1,onChange:e=>a(e)}),(0,v.createElement)(Mo.ZP,{className:"block-editor-format-toolbar__image-container-button",icon:wO.Z,label:(0,N.__)("Apply"),type:"submit"}))))}var gJ=n(91452);const vJ="core/italic",bJ=(0,N.__)("Italic"),yJ={name:vJ,title:bJ,tagName:"em",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r(hl(n,{type:vJ,title:bJ}))}return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"primary",character:"i",onUse:i}),(0,v.createElement)(bZ,{name:"italic",icon:gJ.Z,title:bJ,onClick:function(){r(hl(n,{type:vJ})),o()},isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),(0,v.createElement)(yZ,{inputType:"formatItalic",onInput:i}))}};var _J=n(70874),kJ=n(2746),xJ=n(37703),wJ=n(67256),CJ=n(2355),EJ=n(72123),SJ=n(62036),IJ=n(28452),TJ=n(78072),NJ=n(17404);function BJ(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,YM.E)(t);if(!(0,kJ.M)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,xJ.C)(t);if(!(0,wJ.x)(n))return!1;const r=(0,CJ.D)(t);if(r&&!(0,EJ.t)(r))return!1;const o=(0,SJ.W)(t);if(o&&!(0,IJ.A)(o))return!1;const i=(0,TJ.S)(t);if(i&&!(0,NJ.Z)(i))return!1}return!(t.startsWith("#")&&!(0,NJ.Z)(t))}function LJ(e,t){var n,r,o;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end;const a={start:null,end:null},{formats:s}=e;let c,u;if(null==s||!s.length)return a;const d=s.slice(),p=null===(n=d[i])||void 0===n?void 0:n.find((e=>{let{type:n}=e;return n===t.type})),m=null===(r=d[l])||void 0===r?void 0:r.find((e=>{let{type:n}=e;return n===t.type})),f=null===(o=d[l-1])||void 0===o?void 0:o.find((e=>{let{type:n}=e;return n===t.type}));if(p)c=p,u=i;else if(m)c=m,u=l;else{if(!f)return a;c=f,u=l-1}const h=d[u].indexOf(c),g=[d,u,c,h];return i=DJ(...g),l=RJ(...g),i=i<0?0:i,{start:i,end:l}}function PJ(e,t,n,r,o){let i=t;const l={forwards:1,backwards:-1}[o]||1,a=-1*l;for(;e[i]&&e[i][r]===n;)i+=l;return i+=a,i}const AJ=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const{getSettings:t}=e(ku),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),h={url:n.url,type:n.type,id:n.id,opensInNewTab:"_blank"===n.target,title:u,...d},g=gl({editableContentElement:s.current,value:o,settings:HJ}),b=function(e){if(e)return MJ.has(e)?ZJ(MJ.get(e)):(OJ+=1,MJ.set(e,OJ),ZJ(OJ))}(g),y=(0,v.useRef)(!!r&&"firstElement");return(0,v.createElement)(T.Z,{anchor:g,focusOnMount:y.current,onClose:a,placement:"bottom",shift:!0},(0,v.createElement)(fO,{key:b,value:h,onChange:function(e){e={...d,...e};const n=h.opensInNewTab!==e.opensInNewTab&&h.url===e.url,r=n&&void 0===e.url;if(p(r?e:void 0),r)return;const s=(0,XM.u)(e.url),c=function(e){let{url:t,type:n,id:r,opensInNewWindow:o}=e;const i={type:"core/link",attributes:{url:t}};return n&&(i.attributes.type=n),r&&(i.attributes.id=r),o&&(i.attributes.target="_blank",i.attributes.rel="noreferrer noopener"),i}({url:s,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewWindow:e.opensInNewTab}),m=e.title||s;if(ji(o)&&!t){const e=xi(Ii({text:m}),c,0,m.length);i(Ui(o,e))}else{let e;if(m===u)e=xi(o,c);else{e=Ii({text:m}),e=xi(e,c,0,m.length);const t=LJ(o,{type:"core/link"}),[n,r]=Yi(o,t.start,t.start);e=function(){for(var e=arguments.length,t=new Array(e),n=0;n%s"),e),{mark:(0,v.createElement)("mark",null)})},hasTextControl:!0}))}));const jJ="core/link",zJ=(0,N.__)("Link"),HJ={name:jJ,title:zJ,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,t){let{html:n,plainText:r}=t;if(ji(e))return e;const o=(n||r).replace(/<[^>]+>/g,"").trim();return(0,SM.P)(o)?(window.console.log("Created link:\n\n",o),xi(e,{type:jJ,attributes:{url:(0,Dn.decodeEntities)(o)}})):e},edit:function(e){let{isActive:t,activeAttributes:n,value:r,onChange:o,onFocus:i,contentRef:l}=e;const[a,s]=(0,v.useState)(!1);function c(){const e=Fi(Ki(r));e&&(0,SM.P)(e)&&BJ(e)?o(xi(r,{type:jJ,attributes:{url:e}})):e&&(0,_J.J)(e)?o(xi(r,{type:jJ,attributes:{url:`mailto:${e}`}})):s(!0)}function u(){o(Wi(r,jJ)),(0,fl.D)((0,N.__)("Link removed."),"assertive")}return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"primary",character:"k",onUse:c}),(0,v.createElement)(vZ,{type:"primaryShift",character:"k",onUse:u}),t&&(0,v.createElement)(bZ,{name:"link",icon:oT.Z,title:(0,N.__)("Unlink"),onClick:u,isActive:t,shortcutType:"primaryShift",shortcutCharacter:"k"}),!t&&(0,v.createElement)(bZ,{name:"link",icon:rT.Z,title:zJ,onClick:c,isActive:t,shortcutType:"primary",shortcutCharacter:"k"}),(a||t)&&(0,v.createElement)(FJ,{addingLink:a,stopAddingLink:function(){s(!1),i()},isActive:t,activeAttributes:n,value:r,onChange:o,contentRef:l}))}},VJ="core/strikethrough",WJ=(0,N.__)("Strikethrough"),$J={name:VJ,title:WJ,tagName:"s",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;function i(){r(hl(n,{type:VJ,title:WJ})),o()}return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"access",character:"d",onUse:i}),(0,v.createElement)(bZ,{icon:TP.Z,title:WJ,onClick:i,isActive:t,role:"menuitemcheckbox"}))}},UJ="core/underline",GJ=(0,N.__)("Underline"),qJ={name:UJ,title:GJ,tagName:"span",className:null,attributes:{style:"style"},edit(e){let{value:t,onChange:n}=e;const r=()=>{n(hl(t,{type:UJ,attributes:{style:"text-decoration: underline;"},title:GJ}))};return(0,v.createElement)(v.Fragment,null,(0,v.createElement)(vZ,{type:"primary",character:"u",onUse:r}),(0,v.createElement)(yZ,{inputType:"formatUnderline",onInput:r}))}};var KJ=n(19811),YJ=n(26905);function XJ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==nQ&&(e.backgroundColor=r)}return e}),{})}function JJ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=CB(t,r);e.color=o.color}return e}),{})}function QJ(e,t,n){const r=Oi(e,t);return r?{...XJ(r.attributes.style),...JJ(r.attributes.class,n)}:{}}function eQ(e){let{name:t,property:n,value:r,onChange:o}=e;const i=(0,E.Z)((e=>{var t;const{getSettings:n}=e(ku);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),l=(0,v.useCallback)((e=>{o(function(e,t,n,r){const{color:o,backgroundColor:i}={...QJ(e,t,n),...r};if(!o&&!i)return Wi(e,t);const l=[],a=[],s={};if(i?l.push(["background-color",i].join(":")):l.push(["background-color",nQ].join(":")),o){const e=EB(n,o);e?a.push(SB("color",e.slug)):l.push(["color",o].join(":"))}return l.length&&(s.style=l.join(";")),a.length&&(s.class=a.join(" ")),xi(e,{type:t,attributes:s})}(r,t,i,{[n]:e}))}),[i,o,n]),a=(0,v.useMemo)((()=>QJ(r,t,i)),[t,r,i]);return(0,v.createElement)(PR,{value:a[n],onChange:l})}function tQ(e){let{name:t,value:n,onChange:r,onClose:o,contentRef:i}=e;const l=function(e){const[t,n]=(0,v.useState)(e);return(0,v.useEffect)((()=>{e&&n(e)}),[e]),t}(gl({editableContentElement:i.current,value:n,settings:aQ}));return(0,v.createElement)(T.Z,{onClose:o,className:"components-inline-color-popover",anchor:l},(0,v.createElement)(cC.Z,{tabs:[{name:"color",title:(0,N.__)("Text")},{name:"backgroundColor",title:(0,N.__)("Background")}]},(e=>(0,v.createElement)(eQ,{name:t,property:e.name,value:n,onChange:r}))))}const nQ="rgba(0, 0, 0, 0)",rQ="core/text-color",oQ=(0,N.__)("Highlight"),iQ=[];function lQ(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===nQ&&e.parentElement?lQ(e.parentElement,t):o}const aQ={name:rQ,title:oQ,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color",nQ].join(":");return t?[n,t].join(";"):n},edit:function(e){let{value:t,onChange:n,isActive:r,activeAttributes:o,contentRef:i}=e;const l=bp("color.custom"),a=bp("color.palette")||iQ,[s,c]=(0,v.useState)(!1),u=(0,v.useCallback)((()=>c(!0)),[c]),d=(0,v.useCallback)((()=>c(!1)),[c]),p=(0,v.useMemo)((()=>function(e,t){let{color:n,backgroundColor:r}=t;if(n||r)return{color:n||lQ(e,"color"),backgroundColor:r===nQ?lQ(e,"background-color"):r}}(i.current,QJ(t,rQ,a))),[t,a]),m=a.length||!l;return m||r?(0,v.createElement)(v.Fragment,null,(0,v.createElement)(bZ,{className:"format-library-text-color-button",isActive:r,icon:(0,v.createElement)(om.Z,{icon:Object.keys(o).length?KJ.Z:YJ.Z,style:p}),title:oQ,onClick:m?u:()=>n(Wi(t,rQ)),role:"menuitemcheckbox"}),s&&(0,v.createElement)(tQ,{name:rQ,onClose:d,activeAttributes:o,value:t,onChange:n,contentRef:i})):null}};var sQ=n(19942);const cQ="core/subscript",uQ=(0,N.__)("Subscript"),dQ={name:cQ,title:uQ,tagName:"sub",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,v.createElement)(bZ,{icon:sQ.Z,title:uQ,onClick:function(){r(hl(n,{type:cQ,title:uQ})),o()},isActive:t,role:"menuitemcheckbox"})}};var pQ=n(281);const mQ="core/superscript",fQ=(0,N.__)("Superscript"),hQ={name:mQ,title:fQ,tagName:"sup",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,v.createElement)(bZ,{icon:pQ.Z,title:fQ,onClick:function(){r(hl(n,{type:mQ,title:fQ})),o()},isActive:t,role:"menuitemcheckbox"})}};var gQ=n(35779);const vQ="core/keyboard",bQ=(0,N.__)("Keyboard input"),yQ={name:vQ,title:bQ,tagName:"kbd",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;return(0,v.createElement)(bZ,{icon:gQ.Z,title:bQ,onClick:function(){r(hl(n,{type:vQ,title:bQ})),o()},isActive:t,role:"menuitemcheckbox"})}};var _Q=n(53124);const kQ="core/unknown",xQ=(0,N.__)("Clear Unknown Formatting"),wQ={name:kQ,title:xQ,tagName:"*",className:null,edit(e){let{isActive:t,value:n,onChange:r,onFocus:o}=e;const i=Ki(n).formats.some((e=>e.some((e=>e.type===kQ))));return t||i?(0,v.createElement)(bZ,{name:"unknown",icon:_Q.Z,title:xQ,onClick:function(){r(Wi(n,kQ)),o()},isActive:!0}):null}};[lJ,uJ,fJ,yJ,HJ,$J,qJ,aQ,dQ,hQ,yQ,wQ].forEach((e=>{let{name:t,...n}=e;return Vi(t,n)}));const CQ="mailpoet-form/font-selection",EQ=["core/paragraph","core/heading"],SQ={name:CQ,title:"Font Selection",tagName:"span",className:"mailpoet-has-font",attributes:{style:"style",font:"data-font"},edit:function(e){let{value:t,onChange:n,activeAttributes:r}=e;const o=(0,E.Z)((e=>e("core/block-editor").getSelectedBlock()),[]);return EQ.includes(o.name)?(0,zF.jsx)(Du,{children:(0,zF.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,zF.jsx)(gG,{value:r.font,onChange:e=>{n(xi(t,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${e}`,font:e}}))},name:OF.x.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var IQ=n(22058),TQ=n(29449),NQ=n(15317),BQ=n(58125),LQ=n(20360);const PQ="mailpoet-form-editor-templates";function AQ(){const e=[{name:"popup",label:OF.x.I18n.t("popupCategory")},{name:"slide_in",label:OF.x.I18n.t("slideInCategory")},{name:"fixed_bar",label:OF.x.I18n.t("fixedBarCategory")},{name:"below_posts",label:OF.x.I18n.t("belowPagesCategory")},{name:"others",label:OF.x.I18n.t("othersCategory")}],t=(0,E.Z)((e=>e(PQ).getSelectedCategory()),[]),n=(0,E.Z)((e=>e(PQ).getTemplates()),[]),r=(0,E.Z)((e=>e(PQ).getLoading()),[]),o=(0,E.Z)((e=>e(PQ).getSelectTemplateFailed()),[]),{selectTemplate:i,selectCategory:l}=(0,S.Z)(PQ);return(0,zF.jsxs)(zF.Fragment,{children:[e.map((e=>n[e.name].map(((e,t)=>t<4&&(0,zF.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))))),(0,zF.jsxs)("div",{className:"mailpoet-template-selection-header",children:[(0,zF.jsx)(RY.X,{level:4,children:OF.x.I18n.t("selectTemplate")}),(0,zF.jsx)(MF.Button,{automationId:"create_blank_form",onClick:()=>{i("initial_form","Blank template")},children:OF.x.I18n.t("createBlankTemplate")})]}),o&&(0,zF.jsx)(LQ.q,{type:"error",scroll:!0,renderInPlace:!0,children:(0,zF.jsx)("p",{children:OF.x.I18n.t("createFormError")})}),(0,zF.jsxs)("div",{"data-automation-id":"template_selection_list",children:[(0,zF.jsx)(TQ.A,{color:"#fff"}),(0,zF.jsxs)("div",{className:"mailpoet-templates",children:[(0,zF.jsx)(IQ.R,{categories:e,active:t,onSelect:l}),n[t].map((e=>(0,zF.jsx)(BQ.G,{onSelect:()=>{i(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,zF.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,zF.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id)))]})]}),r&&(0,zF.jsx)(NQ.g,{})]})}const DQ={getTemplates:e=>e.templates,getFormEditorUrl:e=>e.formEditorUrl,getSelectTemplateFailed:e=>e.selectTemplateFailed,getLoading:e=>e.loading,getSelectedCategory:e=>e.activeCategory},RQ=e=>({...e,selectTemplateFailed:!0,loading:!1}),MQ=e=>({...e,selectTemplateFailed:!1,loading:!0}),OQ=(e,t)=>({...e,activeCategory:t.category}),ZQ=e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"SELECT_TEMPLATE_ERROR":return RQ(t);case"SELECT_TEMPLATE_START":return MQ(t);case"SELECT_CATEGORY":return OQ(t,n);default:return t}};function*FQ(e,t){yield{type:"SELECT_TEMPLATE_START"},yield{type:"TRACK_EVENT",name:"Forms > Template selected",data:{"Template id":e,"Template name":t},timeout:200};const n=(0,$.select)(PQ).getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function jQ(e){return{type:"SELECT_CATEGORY",category:e}}var zQ=n(46881);let HQ;function VQ(){return(0,zF.jsx)(_.k.Provider,{value:(0,_.S)(window),children:(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(k.w,{}),(0,zF.jsx)(AQ,{})]})})}!function(e){e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others"}(HQ||(HQ={}));const WQ=document.querySelector("#mailpoet_form_edit_templates");function $Q(){return(0,zF.jsx)(_.k.Provider,{value:(0,_.S)(window),children:(0,zF.jsxs)(zF.Fragment,{children:[(0,zF.jsx)(k.w,{}),(0,zF.jsx)(eJ,{})]})})}WQ&&((0,MF.registerTranslations)(),(()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:HQ.Popup},t={selectors:DQ,actions:h,controls:g,reducer:ZQ(e),resolvers:{}},n=(0,W.Z)(PQ,t);(0,$.register)(n)})(),b.render((0,zF.jsx)(v.StrictMode,{children:(0,zF.jsx)(VQ,{})}),WQ)),window.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("#mailpoet_form_edit");e&&(y.default.use(y.default.createRootURLMiddleware(window.wpApiSettings.root)),y.default.use(y.default.createNonceMiddleware(window.wpApiSettings.nonce)),(0,_e.KJ)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",(()=>M)),(()=>{const e=window.mailpoet_custom_fields.map((e=>({...e,params:e.params||{}}))),t=tG($F,Uo.colors,Uo.gradients,e),n={...window.mailpoet_form_data},r=t(n.body);delete n.body;const o={dateTypes:window.mailpoet_date_types,dateFormats:window.mailpoet_date_formats,months:window.mailpoet_month_names};n.settings.segments=n.settings.segments?n.settings.segments:[];let i,l=null;if(null!==n.id)try{l=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===l.formType&&(l.formType="below_posts")}catch(e){}try{i=JSON.parse(window.localStorage.getItem("mailpoet_form_view_options"))}catch(e){i=!1}const a={editorHistory:[],editorHistoryOffset:0,formBlocks:r,formData:NY(n),dateSettingData:o,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:Oj(n,r),segments:window.mailpoet_form_segments,customFields:e,isFormSaving:!1,isCustomFieldSaving:!1,isCustomFieldCreating:!1,isPreviewShown:!1,isPreviewReady:!1,isCustomFieldDeleting:!1,inserterPanel:null,notices:[],hasUnsavedChanges:!1,sidebar:{activeSidebar:"default",activeTab:"form",openedPanels:["basic-settings"]},previewSettings:l,fullscreenStatus:i,editorUrl:window.location.href,formEditorUrl:window.mailpoet_form_edit_url,previewPageUrl:window.mailpoet_form_preview_page,closeIconsUrl:window.mailpoet_close_icons_url,customFonts:window.mailpoet_custom_fonts,allWpPosts:window.mailpoet_all_wp_posts,allWpPages:window.mailpoet_all_wp_pages,allWpCategories:window.mailpoet_all_wp_categories,allWpTags:window.mailpoet_all_wp_tags,allWooCommerceProducts:window.mailpoet_woocommerce_products,allWooCommerceCategories:window.mailpoet_woocommerce_categories,allWooCommerceTags:window.mailpoet_woocommerce_tags,tutorialSeen:"1"===window.mailpoet_tutorial_seen,tutorialUrl:window.mailpoet_tutorial_url,user:{isAdministrator:window.mailpoet_is_administrator}},s={reducer:$j(a),actions:f,selectors:Gj,controls:kY,resolvers:{}},c=(0,W.Z)(WF,s);(0,$.register)(c)})(),(()=>{const e=(0,$.select)(WF).getAllAvailableCustomFields();zG.supports.inserter=(0,$.select)(WF).isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:OF.x.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:OF.x.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:OF.x.I18n.t("customFieldsBlocksCategory")}),function(e){(0,$.dispatch)(Xt).setCategories(e)}(t),ae("mailpoet-form/divider",uG),ae("mailpoet-form/email-input",mG),ae("mailpoet-form/submit-button",_G),ae("mailpoet-form/first-name-input",wG),ae("mailpoet-form/last-name-input",SG),ae("mailpoet-form/segment-select",DG),ae("mailpoet-form/html",zG),ae("mailpoet-form/add-custom-field",UG),ae(dq,mq),ae(_q,xq),ae(mK,hK),ae(Uq,qq),ae(hY,vY),Array.isArray(e)&&e.forEach(bY)})(),Vi(CQ,SQ),window.mailpoet_translations.forEach((e=>{var t;const n=JSON.parse(e);n&&null!==(t=n.locale_data)&&void 0!==t&&t.messages&&(0,N.setLocaleData)(n.locale_data.messages)})),(0,MF.registerTranslations)(),b.render((0,zF.jsx)(v.StrictMode,{children:(0,zF.jsx)($Q,{})}),e))}))},41779:function(e,t){var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r2),g=/Android/.test(e),v=h||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=h||/Mac/.test(t),y=/\bCrOS\b/.test(e),_=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(d=!1,s=!0);var x=b&&(c||d&&(null==k||k<12.11)),w=n||l&&a>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,S=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function I(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return I(e).appendChild(t)}function N(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i=t)return l+(t-i);l+=a-i,l+=n-l%n,i=a+1}}h?R=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(R=function(e){try{e.select()}catch(e){}});var F=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};function j(e,t){for(var n=0;n=t)return r+Math.min(l,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var U=[""];function G(e){for(;U.length<=e;)U.push(q(U)+" ");return U[e]}function q(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}var le=null;function ae(e,t,n){var r;le=null;for(var o=0;ot)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:le=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:le=o)}return null!=r?r:le}var se=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,o=/[1n]/;function i(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,a){var s,c="ltr"==a?"L":"R";if(0==l.length||"ltr"==a&&!e.test(l))return!1;for(var u=l.length,d=[],p=0;p-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function fe(e,t){var n=pe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function be(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ke(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){ye(e),_e(e)}function we(e){return e.target||e.srcElement}function Ce(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ee,Se,Ie=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Te(e){if(null==Ee){var t=N("span","​");T(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Ee?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ne(e){if(null!=Se)return Se;var t=T(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return I(e),!(!n||n.left==n.right)&&(Se=r.right-n.right<3)}var Be,Le=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),l=i.indexOf("\r");-1!=l?(n.push(i.slice(0,l)),t+=l+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ae="oncopy"in(Be=N("div"))||(Be.setAttribute("oncopy","return;"),"function"==typeof Be.oncopy),De=null;var Re={},Me={};function Oe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Re[e]=t}function Ze(e){if("string"==typeof e&&Me.hasOwnProperty(e))e=Me[e];else if(e&&"string"==typeof e.name&&Me.hasOwnProperty(e.name)){var t=Me[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ze("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ze("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Fe(e,t){t=Ze(t);var n=Re[t.name];if(!n)return Fe(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var o=je[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var je={};function ze(e,t){O(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function He(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ve(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function We(e,t,n){return!e.startState||e.startState(t,n)}var $e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ue(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t=e.first&&tn?et(n,Ue(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ue(e,t.line).text.length)}function st(e,t){for(var n=[],r=0;r=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.post},$e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$e.prototype.backUp=function(e){this.pos-=e},$e.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,n,r){var o=[e.state.modeGen],i={};_t(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),i,r);for(var l=n.state,a=function(r){n.baseTokens=o;var a=e.state.overlays[r],s=1,c=0;n.state=!0,_t(e,t.text,a.mode,n,(function(e,t){for(var n=s;ce&&o.splice(s,1,e,o[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(a.opaque)o.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;ne.options.maxHighlightLength&&He(e.doc.mode,r.state),i=dt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new ut(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=i.first)return i.first;var s=Ue(i,a-1),c=s.stateAfter;if(c&&(!n||a+(c instanceof ct?c.lookAhead:0)<=i.modeFrontier))return a;var u=Z(s.text,null,e.options.tabSize);(null==o||r>u)&&(o=a-1,r=u)}return o}(e,t,n),l=i>r.first&&Ue(r,i-1).stateAfter,a=l?ut.fromSaved(r,l,i):new ut(r,We(r.mode),i);return r.iter(i,t,(function(n){ft(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&rt.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,He(e.mode,t.state),n,t.lookAhead):new ut(e,He(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?He(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bt(e,t,n,r){var o,i,l=e.doc,a=l.mode,s=Ue(l,(t=at(l,t)).line),c=mt(e,t.line,n),u=new $e(s.text,e.options.tabSize,c);for(r&&(i=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&ft(e,t,r,d.pos),d.pos=t.length,s=null):s=yt(gt(n,d,r.state,p),i),p){var m=p[0].name;m&&(s="m-"+(s?m+" "+s:m))}if(!a||u!=s){for(;c=t:i.to>t);(r||(r=[])).push(new wt(l,i.from,a?null:i.to))}}return r}(n,o,l),s=function(e,t,n){var r;if(e)for(var o=0;o=t:i.to>t)||i.from==t&&"bookmark"==l.type&&(!n||i.marker.insertLeft)){var a=null==i.from||(l.inclusiveLeft?i.from<=t:i.from0&&a)for(var y=0;yt)&&(!n||Pt(n,i.marker)<0)&&(n=i.marker)}return n}function Ot(e,t,n,r,o){var i=Ue(e,t),l=xt&&i.markedSpans;if(l)for(var a=0;a=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&o.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Zt(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function Ft(e,t){var n=Ue(e,t),r=Zt(n);return n==r?t:Ye(r)}function jt(e,t){if(t>e.lastLine())return t;var n,r=Ue(e,t);if(!zt(e,r))return t;for(;n=Rt(r);)r=n.find(1,!0).line;return Ye(r)+1}function zt(e,t){var n=xt&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Ut=function(e,t,n){this.text=e,Nt(this,t),this.height=n?n(this):1};function Gt(e){e.parent=null,Tt(e)}Ut.prototype.lineNo=function(){return Ye(this)},be(Ut);var qt={},Kt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Kt:qt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=B("span",null,null,s?"padding-right: .1px":null),r={pre:B("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,l=void 0;r.pos=0,r.addToken=Qt,Ne(e.display.measure)&&(l=ce(i,e.doc.direction))&&(r.addToken=en(r.addToken,l)),r.map=[],nn(i,r,pt(e,i,t!=e.display.externalMeasured&&Ye(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=D(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=D(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Te(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function Jt(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,o,i,s){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;oc&&d.from<=c);p++);if(d.to>=u)return e(n,r,o,i,l,a,s);e(n,r.slice(0,d.to-c),o,i,null,a,s),i=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var l,a,s,c,u,d,p,m=o.length,f=0,h=1,g="",v=0;;){if(v==f){s=c=u=a="",p=null,d=null,v=1/0;for(var b=[],y=void 0,_=0;_f||x.collapsed&&k.to==f&&k.from==f)){if(null!=k.to&&k.to!=f&&v>k.to&&(v=k.to,c=""),x.className&&(s+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&k.from==f&&(u+=" "+x.startStyle),x.endStyle&&k.to==v&&(y||(y=[])).push(x.endStyle,k.to),x.title&&((p||(p={})).title=x.title),x.attributes)for(var w in x.attributes)(p||(p={}))[w]=x.attributes[w];x.collapsed&&(!d||Pt(d.marker,x)<0)&&(d=k)}else k.from>f&&v>k.from&&(v=k.from)}if(y)for(var C=0;C=m)break;for(var S=Math.min(m,v);;){if(g){var I=f+g.length;if(!d){var T=I>S?g.slice(0,S-f):g;t.addToken(t,T,l?l+s:s,u,f+T.length==v?c:"",a,p)}if(I>=S){g=g.slice(S-f),f=S;break}f=I,u=""}g=o.slice(i,i=n[h++]),l=Yt(n[h++],t.cm.options)}}else for(var N=1;Nn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function Bn(e,t,n,r){return An(e,Pn(e,t),n,r)}function Ln(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&i.push((s.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=Mn(t.map,n,r),s=i.node,c=i.start,u=i.end,d=i.collapse;if(3==s.nodeType){for(var p=0;p<4;p++){for(;c&&re(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var m;c>0&&(d=r="right"),o=e.options.lineWrapping&&(m=s.getClientRects()).length>1?m["right"==r?m.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!c&&(!o||!o.left&&!o.right)){var f=s.parentNode.getClientRects()[0];o=f?{left:f.left,right:f.left+or(e.display),top:f.top,bottom:f.bottom}:Rn}for(var h=o.top-t.rect.top,g=o.bottom-t.rect.top,v=(h+g)/2,b=t.view.measure.heights,y=0;yt)&&(o=(i=s-a)-1,t>=s&&(l="right")),null!=o){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==o)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&o==s-a)for(;c=0&&(n=e[o]).left==n.right;o--);return n}function Zn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(s=r.text.length,c="before"):s<=0&&(s=0,c="after"),!a)return l("before"==c?s-1:s,"before"==c);function u(e,t,n){return l(n?e-1:e,1==a[t].level!=n)}var d=ae(a,s,c),p=le,m=u(s,d,"before"==c);return null!=p&&(m.other=u(s,p,"before"!=c)),m}function qn(e,t){var n=0;t=at(e.doc,t),e.options.lineWrapping||(n=or(e.display)*t.ch);var r=Ue(e.doc,t.line),o=Vt(r)+wn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Kn(e,t,n,r,o){var i=et(e,t,n);return i.xRel=o,r&&(i.outside=r),i}function Yn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var o=Xe(r,n),i=r.first+r.size-1;if(o>i)return Kn(r.first+r.size-1,Ue(r,i).text.length,null,1,1);t<0&&(t=0);for(var l=Ue(r,o);;){var a=er(e,l,o,t,n),s=Mt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var c=s.find(1);if(c.line==o)return c;l=Ue(r,o=c.line)}}function Xn(e,t,n,r){r-=Vn(t);var o=t.text.length,i=ie((function(t){return An(e,n,t-1).bottom<=r}),o,0);return{begin:i,end:o=ie((function(t){return An(e,n,t).top>r}),i,o)}}function Jn(e,t,n,r){return n||(n=Pn(e,t)),Xn(e,t,n,Wn(e,t,An(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,o){o-=Vt(t);var i=Pn(e,t),l=Vn(t),a=0,s=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?nr:tr)(e,t,n,i,u,r,o);a=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var p,m,f=null,h=null,g=ie((function(t){var n=An(e,i,t);return n.top+=l,n.bottom+=l,!!Qn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(f=t,h=n),!0)}),a,s),v=!1;if(h){var b=r-h.left=_.bottom?1:0}return Kn(n,g=oe(t.text,g,1),m,v,r-p)}function tr(e,t,n,r,o,i,l){var a=ie((function(a){var s=o[a],c=1!=s.level;return Qn(Gn(e,et(n,c?s.to:s.from,c?"before":"after"),"line",t,r),i,l,!0)}),0,o.length-1),s=o[a];if(a>0){var c=1!=s.level,u=Gn(e,et(n,c?s.from:s.to,c?"after":"before"),"line",t,r);Qn(u,i,l,!0)&&u.top>l&&(s=o[a-1])}return s}function nr(e,t,n,r,o,i,l){var a=Xn(e,t,r,l),s=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p=c||m.to<=s)){var f=An(e,r,1!=m.level?Math.min(c,m.to)-1:Math.max(s,m.from)).right,h=fh)&&(u=m,d=h)}}return u||(u=o[o.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(N("br"));Dn.appendChild(document.createTextNode("x"))}T(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),I(e.measure),n||1}function or(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function ir(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,l=0;i;i=i.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=i.offsetLeft+i.clientLeft+o,r[a]=i.clientWidth}return{fixedPos:lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ar(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/or(e.display)-3);return function(o){if(zt(e.doc,o))return 0;var i=0;if(o.widgets)for(var l=0;l0&&(s=Ue(e.doc,c.line).text).length==c.ch){var u=Z(s,s.length,e.options.tabSize)-s.length;c=et(c.line,Math.max(0,Math.round((i-En(e.display).left)/or(e.display))-u))}return c}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)xt&&Ft(e.doc,t)o.viewFrom?mr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)mr(e);else if(t<=o.viewFrom){var i=fr(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):mr(e)}else if(n>=o.viewTo){var l=fr(e,t,t,-1);l?(o.view=o.view.slice(0,l.index),o.viewTo=l.lineN):mr(e)}else{var a=fr(e,t,t,-1),s=fr(e,n,n+r,1);a&&s?(o.view=o.view.slice(0,a.index).concat(on(e,a.lineN,s.lineN)).concat(o.view.slice(s.index)),o.viewTo+=r):mr(e)}var c=o.externalMeasured;c&&(n=o.lineN&&t=r.viewTo)){var i=r.view[ur(e,t)];if(null!=i.node){var l=i.changes||(i.changes=[]);-1==j(l,n)&&l.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fr(e,t,n,r){var o,i=ur(e,t),l=e.display.view;if(!xt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Ft(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function hr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,n){var r=e.display,o=e.doc,i=document.createDocumentFragment(),l=En(e.display),a=l.left,s=Math.max(r.sizerWidth,In(e)-r.sizer.offsetLeft)-l.right,c="ltr"==o.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var i,l,d=Ue(o,t),p=d.text.length;function m(n,r){return Un(e,et(t,n),"div",d,r)}function f(t,n,r){var o=Jn(e,d,null,t),i="ltr"==n==("after"==r)?"left":"right";return m("after"==r?o.begin:o.end-(/\s/.test(d.text.charAt(o.end-1))?2:1),i)[i]}var h=ce(d,o.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;it||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(h,n||0,null==r?p:r,(function(e,t,o,d){var g="ltr"==o,v=m(e,g?"left":"right"),b=m(t-1,g?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,k=0==d,x=!h||d==h.length-1;if(b.top-v.top<=3){var w=(c?_:y)&&x,C=(c?y:_)&&k?a:(g?v:b).left,E=w?s:(g?b:v).right;u(C,v.top,E-C,v.bottom)}else{var S,I,T,N;g?(S=c&&y&&k?a:v.left,I=c?s:f(e,o,"before"),T=c?a:f(t,o,"after"),N=c&&_&&x?s:b.right):(S=c?f(e,o,"before"):a,I=!c&&y&&k?s:v.right,T=!c&&_&&x?a:b.left,N=c?f(t,o,"after"):s),u(S,v.top,I-S,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Er(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Cr(e))}function wr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Er(e))}),100)}function Cr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,A(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),kr(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Sr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,i=0,s=0;s.005||h<-.005)&&(oe.display.sizerWidth){var v=Math.ceil(p/or(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(t.scroller.scrollTop+=i)}function Ir(e){if(e.widgets)for(var t=0;t=l&&(i=Xe(t,Vt(Ue(t,s))-e.wrapper.clientHeight),l=s)}return{from:i,to:Math.max(l,i+1)}}function Nr(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Tn(e),l={};t.bottom-t.top>i&&(t.bottom=t.top+i);var a=e.doc.height+Cn(n),s=t.topa-r;if(t.topo+i){var u=Math.min(t.top,(c?a:t.bottom)-i);u!=o&&(l.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,m=In(e)-n.gutters.offsetWidth,f=t.right-t.left>m;return f&&(t.right=t.left+m),t.left<10?l.scrollLeft=0:t.leftm+p-3&&(l.scrollLeft=t.right+(f?0:10)-m),l}function Br(e,t){null!=t&&(Ar(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Lr(e){Ar(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pr(e,t,n){null==t&&null==n||Ar(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ar(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Dr(e,qn(e,t.from),qn(e,t.to),t.margin))}function Dr(e,t,n,r){var o=Nr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Pr(e,o.scrollLeft,o.scrollTop)}function Rr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||so(e,{top:t}),Mr(e,t,!0),n&&so(e),ro(e,100))}function Mr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Or(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,po(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Zr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Cn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Fr=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),de(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),de(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Fr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fr.prototype.zeroWidthHack=function(){var e=b&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},Fr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var o=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Fr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var jr=function(){};function zr(e,t){t||(t=Zr(e));var n=e.display.barWidth,r=e.display.barHeight;Hr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Sr(e),Hr(e,Zr(e)),n=e.display.barWidth,r=e.display.barHeight}function Hr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}jr.prototype.update=function(){return{bottom:0,right:0}},jr.prototype.setScrollLeft=function(){},jr.prototype.setScrollTop=function(){},jr.prototype.clear=function(){};var Vr={native:Fr,null:jr};function Wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Or(e,t):Rr(e,t)}),e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var $r=0;function Ur(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$r,markArrays:null},t=e.curOp,ln?ln.ops.push(t):t.ownsGroup=ln={ops:[t],delayedCallbacks:[]}}function Gr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kr(e){e.updatedDisplay=e.mustUpdate&&lo(e.cm,e.update)}function Yr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Sr(t),e.barMeasure=Zr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Bn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-In(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Xr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!f){var i=N("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-wn(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}(t,function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?et(t.line,t.ch+1,"before"):t,t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i=0;i<5;i++){var l=!1,a=Gn(e,t),s=n&&n!=t?Gn(e,n):a,c=Nr(e,o={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Rr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(Or(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(l=!0)),!l)break}return o}(t,at(r,e.scrollToPos.from),at(r,e.scrollToPos.to),e.scrollToPos.margin));var o=e.maybeHiddenMarkers,i=e.maybeUnhiddenMarkers;if(o)for(var l=0;l=e.display.viewTo)){var n=+new Date+e.options.workTime,r=mt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(i){if(r.line>=e.display.viewFrom){var l=i.styles,a=i.text.length>e.options.maxHighlightLength?He(t.mode,r.state):null,s=dt(e,i,r,!0);a&&(r.state=a),i.styles=s.styles;var c=i.styleClasses,u=s.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var d=!l||l.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&pn)return ro(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Qr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==hr(e))return!1;mo(e)&&(mr(e),t.dims=ir(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(o,n.viewTo)),xt&&(i=Ft(e.doc,i),l=jt(e.doc,l));var a=i!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n})(e,i,l),n.viewOffset=Vt(Ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=hr(e);if(!a&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=P();if(!t||!L(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&L(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,o=e.options.lineNumbers,i=r.lineDiv,l=i.firstChild;function a(t){var n=t.nextSibling;return s&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d-1&&(m=!1),un(e,p,u,n)),m&&(I(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),l=p.node.nextSibling}else{var f=vn(e,p,u,n);i.insertBefore(f,l)}u+=p.size}for(;l;)l=a(l)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=P()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&L(document.body,e.anchorNode)&&L(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),I(n.cursorDiv),I(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ro(e,400)),n.updateLineNumbers=null,!0}function ao(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=In(e))r&&(t.visible=Tr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Cn(e.display)-Tn(e),n.top)}),t.visible=Tr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!lo(e,t))break;Sr(e);var o=Zr(e);gr(e),zr(e,o),uo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function so(e,t){var n=new io(e,t);if(lo(e,n)){Sr(e),ao(e,n);var r=Zr(e);gr(e),zr(e,r),uo(e,r),n.finish()}}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",sn(e,"gutterChanged",e)}function uo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sn(e)+"px"}function po(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",l=0;lc.clientWidth,p=c.scrollHeight>c.clientHeight;if(o&&u||i&&p){if(i&&b&&s)e:for(var m=t.target,f=a.view;m!=c;m=m.parentNode)for(var h=0;h=0&&tt(e,r.to())<=0)return n}return-1};var Co=function(e,t){this.anchor=e,this.head=t};function Eo(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=j(t,o);for(var i=1;i0:s>=0){var c=it(a.from(),l.from()),u=ot(a.to(),l.to()),d=a.empty()?l.from()==l.head:a.from()==a.head;i<=n&&--n,t.splice(--i,2,new Co(d?u:c,d?c:u))}}return new wo(t,n)}function So(e,t){return new wo([new Co(e,t||e)],0)}function Io(e){return e.text?et(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function To(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Io(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Io(t).ch-t.to.ch),et(n,r)}function No(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,f-1),e.insert(a.line+1,v)}sn(e,"change",e,t)}function Ro(e,t,n){!function e(r,o,i){if(r.linked)for(var l=0;la-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(jo(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(o,o.lastOp==r)))l=q(i.changes),0==tt(t.from,t.to)&&0==tt(t.from,l.to)?l.to=Io(t):i.changes.push(Fo(e,t));else{var s=q(o.done);for(s&&s.ranges||Vo(e.sel,o.done),i={changes:[Fo(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,l||fe(e,"historyAdded")}function Ho(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,q(o.done),t))?o.done[o.done.length-1]=t:Vo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&jo(o.undone)}function Vo(e,t){var n=q(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Wo(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i}))}function $o(e){if(!e)return null;for(var t,n=0;n-1&&(q(a)[d]=c[d],delete c[d])}}}return r}function qo(e,t,n,r){if(r){var o=e.anchor;if(n){var i=tt(t,o)<0;i!=tt(n,o)<0?(o=t,t=n):i!=tt(t,n)<0&&(t=n)}return new Co(o,t)}return new Co(n||t,t)}function Ko(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),ei(e,new wo([qo(e.sel.primary(),t,n,o)],0),r)}function Yo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i=t.ch:a.to>t.ch))){if(o&&(fe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(i.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var d=s.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=ai(e,d,-r,d&&d.line==t.line?i:null)),d&&d.line==t.line&&(p=tt(d,n))&&(r<0?p<0:p>0))return ii(e,d,t,r,o)}var m=s.find(r<0?-1:1);return(r<0?c:u)&&(m=ai(e,m,r,m.line==t.line?i:null)),m?ii(e,m,t,r,o):null}}return t}function li(e,t,n,r,o){var i=r||1;return ii(e,t,n,i,o)||!o&&ii(e,t,n,i,!0)||ii(e,t,n,-i,o)||!o&&ii(e,t,n,-i,!0)||(e.cantEdit=!0,et(e.first,0))}function ai(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:n>0&&t.ch==(r||Ue(e,t.line)).text.length?t.line0)){var u=[s,1],d=tt(c.from,a.from),p=tt(c.to,a.to);(d<0||!l.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(p>0||!l.inclusiveRight&&!p)&&u.push({from:a.to,to:c.to}),o.splice.apply(o,u),s+=u.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)di(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else di(e,t)}}function di(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=No(e,t);zo(e,t,n,e.cm?e.cm.curOp.id:NaN),fi(e,t,n,St(e,t));var r=[];Ro(e,(function(e,n){n||-1!=j(r,e.history)||(bi(e.history,t),r.push(e.history)),fi(e,t,null,St(e,t))}))}}function pi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,i=e.history,l=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,c=0;c=0;--m){var f=p(m);if(f)return f.v}}}}function mi(e,t){if(0!=t&&(e.first+=t,e.sel=new wo(K(e.sel.ranges,(function(e){return new Co(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linei&&(t={from:t.from,to:et(i,Ue(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ge(e,t.from,t.to),n||(n=No(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,l=t.to,a=!1,s=i.line;e.options.lineWrapping||(s=Ye(Zt(Ue(r,i.line))),r.iter(s,l.line+1,(function(e){if(e==o.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Do(r,t,n,ar(e)),e.options.lineWrapping||(r.iter(s,i.line+t.text.length,(function(e){var t=Wt(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var o=Ue(e,r).stateAfter;if(o&&(!(o instanceof ct)||r+o.lookAhead1||!(this.children[0]instanceof _i))){var a=[];this.collapse(a),this.children=[new _i(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=o.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==l&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=B("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Ot(e,t.line,t,n,i)||t.line!=n.line&&Ot(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}i.addToHistory&&zo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&Zt(r)==c.display.maxLine&&(a=!0),i.collapsed&&s!=t.line&&Ke(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new wt(i,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),i.collapsed&&e.iter(t.line,n.line+1,(function(t){zt(e,t)&&Ke(t,0)})),i.clearOnEnter&&de(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(kt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++Ci,i.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),i.collapsed)dr(c,t.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=t.line;u<=n.line;u++)pr(c,u,"text");i.atomic&&ri(c.doc),sn(c,"markerAdded",c,i)}return i}Ei.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ur(e),ve(this,"clear")){var n=this.find();n&&sn(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ri(e.doc)),e&&sn(e,"markerCleared",e,this,r,o),t&&Gr(e),this.parent&&this.parent.clear()}},Ei.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;s--)ui(this,r[s]);a?Qo(this,a):this.cm&&Lr(this.cm)})),undo:no((function(){pi(this,"undo")})),redo:no((function(){pi(this,"redo")})),undoSelection:no((function(){pi(this,"undo",!0)})),redoSelection:no((function(){pi(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=at(this,e),t=at(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(i){var l=i.markedSpans;if(l)for(var a=0;a=s.to||null==s.from&&o!=e.line||null!=s.from&&o==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=i,++n})),at(this,et(n,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),ti(t.doc,So(n,n)),p)for(var m=0;m=0;t--)hi(e.doc,"",r[t].from,r[t].to,"+delete");Lr(e)}))}function Ji(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qi(e,t,n){var r=Ji(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function el(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var i=ce(n,t.doc.direction);if(i){var l,a=o<0?q(i):i[0],s=o<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Pn(t,n);l=o<0?n.text.length-1:0;var u=An(t,c,l).top;l=ie((function(e){return An(t,c,e).top==u}),o<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Ji(n,l,1))}else l=o<0?a.to:a.from;return new et(r,l,s)}}return new et(r,o<0?n.text.length:0,o<0?"before":"after")}Vi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vi.default=b?Vi.macDefault:Vi.pcDefault;var tl={selectAll:si,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return Xi(e,(function(t){if(t.empty()){var n=Ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new et(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var l=Ue(e.doc,o.line-1).text;l&&(o=new et(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),et(o.line-1,l.length-1),o,"+transpose"))}n.push(new Co(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(tt((o=c.ranges[o]).from(),t)<0||t.xRel>0)&&(tt(o.to(),t)>0||t.xRel<0)?function(e,t,n,r){var o=e.display,i=!1,c=eo(e,(function(t){s&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:wr(e)),me(o.wrapper.ownerDocument,"mouseup",c),me(o.wrapper.ownerDocument,"mousemove",u),me(o.scroller,"dragstart",d),me(o.scroller,"drop",c),i||(ye(t),r.addNew||Ko(e.doc,n,null,null,r.extend),s&&!p||l&&9==a?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),u=function(e){i=i||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return i=!0};s&&(o.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,de(o.wrapper.ownerDocument,"mouseup",c),de(o.wrapper.ownerDocument,"mousemove",u),de(o.scroller,"dragstart",d),de(o.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(e,r,t,i):function(e,t,n,r){l&&wr(e);var o=e.display,i=e.doc;ye(t);var a,s,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(s=i.sel.contains(n),a=s>-1?u[s]:new Co(n,n)):(a=i.sel.primary(),s=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Co(n,n)),n=cr(e,t,!0,!0),s=-1;else{var d=vl(e,n,r.unit);a=r.extend?qo(a,d.anchor,d.head,r.extend):d}r.addNew?-1==s?(s=u.length,ei(i,Eo(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==r.unit&&!r.extend?(ei(i,Eo(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Xo(i,s,a,V):(s=0,ei(i,new wo([a],0),V),c=i.sel);var p=n;function m(t){if(0!=tt(p,t))if(p=t,"rectangle"==r.unit){for(var o=[],l=e.options.tabSize,u=Z(Ue(i,n.line).text,n.ch,l),d=Z(Ue(i,t.line).text,t.ch,l),m=Math.min(u,d),f=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var v=Ue(i,h).text,b=$(v,m,l);m==f?o.push(new Co(et(h,b),et(h,b))):v.length>b&&o.push(new Co(et(h,b),et(h,$(v,f,l))))}o.length||o.push(new Co(n,n)),ei(i,Eo(e,c.ranges.slice(0,s).concat(o),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,_=a,k=vl(e,t,r.unit),x=_.anchor;tt(k.anchor,x)>0?(y=k.head,x=it(_.from(),k.anchor)):(y=k.anchor,x=ot(_.to(),k.head));var w=c.ranges.slice(0);w[s]=function(e,t){var n=t.anchor,r=t.head,o=Ue(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var i=ce(o);if(!i)return t;var l=ae(i,n.ch,n.sticky),a=i[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,c=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==i.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ae(i,r.ch,r.sticky),d=u-l||(r.ch-n.ch)*(1==a.level?-1:1);s=u==c-1||u==c?d<0:d>0}var p=i[c+(s?-1:0)],m=s==(1==p.level),f=m?p.from:p.to,h=m?"after":"before";return n.ch==f&&n.sticky==h?t:new Co(new et(n.line,f,h),r)}(e,new Co(at(i,x),y)),ei(i,Eo(e,w,s),V)}}var f=o.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,l=cr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=tt(l,p)){e.curOp.focus=P(),m(l);var a=Tr(o,i);(l.line>=a.to||l.linef.bottom?20:0;s&&setTimeout(eo(e,(function(){h==n&&(o.scroller.scrollTop+=s,g(t))})),50)}}function v(t){e.state.selectingText=!1,h=1/0,t&&(ye(t),o.input.focus()),me(o.wrapper.ownerDocument,"mousemove",b),me(o.wrapper.ownerDocument,"mouseup",y),i.history.lastSelOrigin=null}var b=eo(e,(function(e){0!==e.buttons&&Ce(e)?g(e):v(e)})),y=eo(e,v);e.state.selectingText=y,de(o.wrapper.ownerDocument,"mousemove",b),de(o.wrapper.ownerDocument,"mouseup",y)}(e,r,t,i)}(t,r,i,e):we(e)==n.scroller&&ye(e):2==o?(r&&Ko(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(w?t.display.input.onContextMenu(e):wr(t)))}}function vl(e,t,n){if("char"==n)return new Co(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Co(et(t.line,0),at(e.doc,et(t.line+1,0)));var r=n(e,t);return new Co(r.from,r.to)}function bl(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ye(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(i>a.bottom||!ve(e,n))return ke(t);i-=a.top-l.viewOffset;for(var s=0;s=o)return fe(e,n,e,Xe(e.doc,i),e.display.gutterSpecs[s].className,t),ke(t)}}function yl(e,t){return bl(e,t,"gutterClick",!0)}function _l(e,t){xn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&bl(e,t,"gutterContextMenu",!1)}(e,t)||he(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function kl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jn(e)}hl.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var xl={toString:function(){return"CodeMirror.Init"}},wl={},Cl={};function El(e,t,n){if(!t!=!(n&&n!=xl)){var r=e.display.dragFunctions,o=t?de:me;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Sl(e){e.options.lineWrapping?(A(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),$t(e)),sr(e),dr(e),jn(e),setTimeout((function(){return zr(e)}),100)}function Il(e,t){var n=this;if(!(this instanceof Il))return new Il(e,t);this.options=t=t?O(t):{},O(wl,t,!1);var r=t.value;"string"==typeof r?r=new Li(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Il.inputStyles[t.inputStyle](this),i=this.display=new vo(e,r,o,t);for(var c in i.wrapper.CodeMirror=this,kl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new F,keySeq:null,specialChars:null},t.autofocus&&!v&&i.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",eo(e,gl)),de(t.scroller,"dblclick",l&&a<11?eo(e,(function(t){if(!he(e,t)){var n=cr(e,t);if(n&&!yl(e,t)&&!xn(e.display,t)){ye(t);var r=e.findWordAt(n);Ko(e.doc,r.anchor,r.head)}}})):function(t){return he(e,t)||ye(t)}),de(t.scroller,"contextmenu",(function(t){return _l(e,t)})),de(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||_l(e,n)}));var n,r={end:0};function o(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function i(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}de(t.scroller,"touchstart",(function(o){if(!he(e,o)&&!i(o)&&!yl(e,o)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!xn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,l=e.coordsChar(t.activeTouch,"page");i=!r.prev||s(r,r.prev)?new Co(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new Co(et(l.line,0),at(e.doc,et(l.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),ye(n)}o()})),de(t.scroller,"touchcancel",o),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Rr(e,t.scroller.scrollTop),Or(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return xo(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return xo(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){he(e,t)||xe(t)},over:function(t){he(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();br(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}(e,t),xe(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Pi<100))xe(t);else if(!he(e,t)&&!xn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:eo(e,Ai),leave:function(t){he(e,t)||Di(e)}};var c=t.input.getField();de(c,"keyup",(function(t){return dl.call(e,t)})),de(c,"keydown",eo(e,ul)),de(c,"keypress",eo(e,pl)),de(c,"focus",(function(t){return Cr(e,t)})),de(c,"blur",(function(t){return Er(e,t)}))}(this),Oi(),Ur(this),this.curOp.forceUpdate=!0,Mo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Cr(n)}),20):Er(this),Cl)Cl.hasOwnProperty(c)&&Cl[c](this,t[c],xl);mo(this),t.finishInit&&t.finishInit(this);for(var u=0;u150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>i.first?Z(Ue(i,t-1).text,null,l):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var m=Math.floor(c/l);m;--m)p+=l,d+="\t";if(pl,s=Le(t),c=null;if(a&&r.ranges.length>1)if(Bl&&Bl.text.join("\n")==t){if(r.ranges.length%Bl.text.length==0){c=[];for(var u=0;u=0;p--){var m=r.ranges[p],f=m.from(),h=m.to();m.empty()&&(n&&n>0?f=et(f.line,f.ch-n):e.state.overwrite&&!a?h=et(h.line,Math.min(Ue(i,h.line).text.length,h.ch+q(s).length)):a&&Bl&&Bl.lineWise&&Bl.text.join("\n")==s.join("\n")&&(f=h=et(f.line,0)));var g={from:f,to:h,text:c?c[p%c.length]:s,origin:o||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};ui(e.doc,g),sn(e,"inputRead",e,g)}t&&!a&&Dl(e,t),Lr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Al(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Pl(t,n,0,null,"paste")})),!0}function Dl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),l=!1;if(i.electricChars){for(var a=0;a-1){l=Nl(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Ue(e.doc,o.head.line).text.slice(0,o.head.ch))&&(l=Nl(e,o.head.line,"smart"));l&&sn(e,"electricInput",e,o.head.line)}}}function Rl(e){for(var t=[],n=[],r=0;r0?0:-1));if(isNaN(u))l=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;l=new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(d?2:1))),-n)}}else l=o?function(e,t,n,r){var o=ce(t,e.doc.direction);if(!o)return Qi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=ae(o,n.ch,n.sticky),l=o[i];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&p>=u.begin)){var m=d?"before":"after";return new et(n.line,p,m)}}var f=function(e,t,r){for(var i=function(e,t){return t?new et(n.line,s(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=l.level),c=a?r.begin:s(r.end,-1);if(l.from<=c&&c0?u.end:s(u.begin,-1);return null==g||r>0&&g==t.text.length||!(h=f(r>0?0:o.length-1,r,c(g)))?null:h}(e.cm,a,t,n):Qi(a,t,n);if(null==l){if(i||((c=t.line+s)=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(a=Ue(e,c)))))return!1;t=el(o,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(n<0)||c(!m);m=!1){var f=a.text.charAt(t.ch)||"\n",h=ee(f,p)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||m||h||(h="s"),u&&u!=h){n<0&&(n=1,c(),t.sticky="after");break}if(h&&(u=h),n>0&&!c(!m))break}var g=li(e,t,i,l,!0);return nt(i,g)&&(g.hitSide=!0),g}function Fl(e,t,n,r){var o,i,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*rr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=Yn(e,a,o)).outside;){if(n<0?o<=0:o>=l.height){i.hitSide=!0;break}o+=5*n}return i}var jl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function zl(e,t){var n=Ln(e,t.line);if(!n||n.hidden)return null;var r=Ue(e.doc,t.line),o=Nn(n,r,t.line),i=ce(r,e.doc.direction),l="left";i&&(l=ae(i,t.ch)%2?"right":"left");var a=Mn(o.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Hl(e,t){return t&&(e.bad=!0),e}function Vl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Hl(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o=t.display.viewTo||i.line=t.display.viewFrom&&zl(t,o)||{node:s[0].measure.map[2],offset:0},u=i.liner.firstLine()&&(l=et(l.line-1,Ue(r.doc,l.line-1).length)),a.ch==Ue(r.doc,a.line).text.length&&a.lineo.viewTo-1)return!1;l.line==o.viewFrom||0==(e=ur(r,l.line))?(t=Ye(o.view[0].line),n=o.view[0].node):(t=Ye(o.view[e].line),n=o.view[e-1].node.nextSibling);var s,c,u=ur(r,a.line);if(u==o.view.length-1?(s=o.viewTo-1,c=o.lineDiv.lastChild):(s=Ye(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",l=!1,a=e.doc.lineSeparator(),s=!1;function c(){l&&(i+=a,s&&(i+=a),l=s=!1)}function u(e){e&&(c(),i+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var i,p=t.getAttribute("cm-marker");if(p){var m=e.findMarks(et(r,0),et(o+1,0),(g=+p,function(e){return e.id==g}));return void(m.length&&(i=m[0].find(0))&&u(Ge(e.doc,i.from,i.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var h=0;h1&&p.length>1;)if(q(d)==q(p))d.pop(),p.pop(),s--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var m=0,f=0,h=d[0],g=p[0],v=Math.min(h.length,g.length);ml.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)m--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(m).replace(/\u200b+$/,"");var k=et(t,m),x=et(s,p.length?q(p).length-f:0);return d.length>1||d[0]||tt(k,x)?(hi(r.doc,d,k,x,"+input"),!0):void 0},jl.prototype.ensurePolled=function(){this.forceCompositionEnd()},jl.prototype.reset=function(){this.forceCompositionEnd()},jl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},jl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return dr(e.cm)}))},jl.prototype.setUneditable=function(e){e.contentEditable="false"},jl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||eo(this.cm,Pl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},jl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},jl.prototype.onContextMenu=function(){},jl.prototype.resetPosition=function(){},jl.prototype.needsContentAttribute=!0;var $l=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};$l.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function i(e){if(!he(r,e)){if(r.somethingSelected())Ll({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Rl(r);Ll({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,H):(n.prevInput="",o.value=t.text.join("\n"),R(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),h&&(o.style.width="0px"),de(o,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),de(o,"paste",(function(e){he(r,e)||Al(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),de(o,"cut",i),de(o,"copy",i),de(e.scroller,"paste",(function(t){if(!xn(e,t)&&!he(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=t.clipboardData,o.dispatchEvent(i)}})),de(e.lineSpace,"selectstart",(function(t){xn(e,t)||ye(t)})),de(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),de(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},$l.prototype.createField=function(e){this.wrapper=Ol(),this.textarea=this.wrapper.firstChild},$l.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$l.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var o=Gn(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+l.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+l.left-i.left))}return r},$l.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$l.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&R(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},$l.prototype.getField=function(){return this.textarea},$l.prototype.supportsTouch=function(){return!1},$l.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},$l.prototype.blur=function(){this.textarea.blur()},$l.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$l.prototype.receivedFocus=function(){this.slowPoll()},$l.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},$l.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},$l.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===o||b&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(r.length,o.length);s1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},$l.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$l.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},$l.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var i=cr(n,e),c=r.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&eo(n,ei)(n.doc,So(i),H);var u,p=o.style.cssText,m=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),r.input.focus(),s&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&g(),w){xe(e);var h=function(){me(window,"mouseup",h),setTimeout(v,20)};de(window,"mouseup",h)}else setTimeout(v,50)}function g(){if(null!=o.selectionStart){var e=n.somethingSelected(),i="​"+(e?o.value:"");o.value="⇚",o.value=i,t.prevInput=e?"":"​",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,o.style.cssText=p,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!l||l&&a<9)&&g();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"​"==t.prevInput?eo(n,si)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},$l.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},$l.prototype.setUneditable=function(){},$l.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=xl&&o(e,t,n)}:o)}e.defineOption=n,e.Init=xl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Lo(e)}),!0),n("indentUnit",2,Lo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Po(e),jn(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(et(r,i))}r++}));for(var o=n.length-1;o>=0;o--)hi(e.doc,t,n[o],et(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=xl&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){kl(e),go(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yi(t),o=n!=xl&&Yi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Sl,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fo(t,e.options.lineNumbers),go(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return zr(e)}),!0),n("scrollbarStyle","native",(function(e){Wr(e),zr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fo(e.options.gutters,t),go(e)}),!0),n("firstLineNumber",1,go,!0),n("lineNumberFormatter",(function(e){return e}),go,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Er(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,El),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Po,!0),n("addModeClass",!1,Po,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Po,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Il),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&eo(this,t[e])(this,n,o),fe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Yi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Nl(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Lr(this));else{var i=o.from(),l=o.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s0&&Xo(this.doc,r,new Co(i,c[r].to()),H)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,n=pt(this,Ue(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var l=r+o>>1;if((l?n[2*l-1]:0)>=i)o=l;else{if(!(n[2*l+1]i&&(e=i,o=!0),r=Ue(this.doc,e)}else r=e;return Wn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Vt(r):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,l,a,s=this.display,c=(e=Gn(this,at(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(s.wrapper.clientHeight,this.doc.height),p=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>p&&(u=p-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==o?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(i=this,l={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(a=Nr(i,l)).scrollTop&&Rr(i,a.scrollTop),null!=a.scrollLeft&&Or(i,a.scrollLeft))},triggerOnKeyDown:to(ul),triggerOnKeyPress:to(pl),triggerOnKeyUp:dl,triggerOnMouseDown:to(gl),execCommand:function(e){if(tl.hasOwnProperty(e))return tl[e].call(null,this)},triggerElectric:to((function(e){Dl(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=at(this.doc,e),l=0;l0&&l(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&sr(this),fe(this,"refresh",this)})),swapDoc:to((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Mo(this,e),jn(this),this.display.input.reset(),Pr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,sn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(Il);var Ul="iter insert remove copy getEditor constructor".split(" ");for(var Gl in Li.prototype)Li.prototype.hasOwnProperty(Gl)&&j(Ul,Gl)<0&&(Il.prototype[Gl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[Gl]));return be(Li),Il.inputStyles={textarea:$l,contenteditable:jl},Il.defineMode=function(e){Il.defaults.mode||"null"==e||(Il.defaults.mode=e),Oe.apply(this,arguments)},Il.defineMIME=function(e,t){Me[e]=t},Il.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Il.defineMIME("text/plain","null"),Il.defineExtension=function(e,t){Il.prototype[e]=t},Il.defineDocExtension=function(e,t){Li.prototype[e]=t},Il.fromTextArea=function(e,t){if((t=t?O(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=P();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var o;if(e.form&&(de(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form;o=i.submit;try{var l=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=l}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var a=Il((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=me,e.on=de,e.wheelEventPixels=ko,e.Doc=Li,e.splitLines=Le,e.countColumn=Z,e.findColumn=$,e.isWordChar=Q,e.Pass=z,e.signal=fe,e.Line=Ut,e.changeEnd=Io,e.scrollbarModel=Vr,e.Pos=et,e.cmpPos=tt,e.modes=Re,e.mimeModes=Me,e.resolveMode=Ze,e.getMode=Fe,e.modeExtensions=je,e.extendMode=ze,e.copyState=He,e.startState=We,e.innerMode=Ve,e.commands=tl,e.keyMap=Vi,e.keyName=Ki,e.isModifierKey=Gi,e.lookupKey=Ui,e.normalizeKeyMap=$i,e.StringStream=$e,e.SharedTextMarker=Ii,e.TextMarker=Ei,e.LineWidget=xi,e.e_preventDefault=ye,e.e_stopPropagation=_e,e.e_stop=xe,e.addClass=A,e.contains=L,e.rmClass=S,e.keyNames=Fi}(Il),Il.version="5.65.2",Il}()},25002:function(e,t,n){!function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?x(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=E),x("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),x("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):e.match(/^\w+-/)?x("meta","meta"):void 0}function C(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),x("string","string")}}function E(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),x(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function I(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:l),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function N(e,t,n){return P[n.context.type](e,t,n)}function B(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return N(e,t,n)}function L(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var P={top:function(e,t,n){if("{"==e)return I(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(_&&/@component/i.test(e))return I(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return I(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return I(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return I(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return I(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return I(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return p.hasOwnProperty(r)?(i="property","maybeprop"):m.hasOwnProperty(r)?(i=k?"string-2":"property","maybeprop"):b?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?P.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?I(n,t,"prop"):N(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&b)return I(n,t,"propBlock");if("}"==e||"{"==e)return B(e,t,n);if("("==e)return I(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)L(t);else if("interpolation"==e)return I(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?B(e,t,n):")"==e?T(n):"("==e?I(n,t,"parens"):"interpolation"==e?I(n,t,"interpolation"):("word"==e&&L(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):N(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&s.hasOwnProperty(t.current())?(i="tag",n.context.type):P.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return I(n,t,"atBlock_parens");if("}"==e||";"==e)return B(e,t,n);if("{"==e)return T(n)&&I(n,t,b?"block":"top");if("interpolation"==e)return I(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":p.hasOwnProperty(r)?"property":m.hasOwnProperty(r)?k?"string-2":"property":v.hasOwnProperty(r)?"atom":g.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?B(e,t,n):"{"==e?T(n)&&I(n,t,b?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?B(e,t,n,2):P.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?I(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):N(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(i="@font-face"==n.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?I(n,t,"top"):N(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?B(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?B(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||w)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=P[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-l)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],a=t(l),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=t(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),p=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],m=t(p),f=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),h=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(g),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),_=n.concat(o).concat(l).concat(s).concat(u).concat(p).concat(g).concat(b);function k(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:f,counterDescriptors:h,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:m,colorKeywords:v,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:d,nonStandardPropertyKeywords:m,fontProperties:f,counterDescriptors:h,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(n(70907))},24481:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},35572:function(e,t,n){t.parse=n(73603),t.stringify=n(64335)},73603:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function n(e){return e?e.replace(/^\s+|\s+$/g,""):""}function r(e,t){var n=e&&"string"==typeof e.type,o=n?e:t;for(var i in e){var l=e[i];Array.isArray(l)?l.forEach((function(e){r(e,o)})):l&&"object"==typeof l&&r(l,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}e.exports=function(e,o){o=o||{};var i=1,l=1;function a(e){var t=e.match(/\n/g);t&&(i+=t.length);var n=e.lastIndexOf("\n");l=~n?e.length-n:l+e.length}function s(){var e={line:i,column:l};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:i,column:l},this.source=o.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(o.source+":"+i+":"+l+": "+t);if(n.reason=t,n.filename=o.source,n.line=i,n.column=l,n.source=e,!o.silent)throw n;u.push(n)}function p(){return h(/^{\s*/)}function m(){return h(/^}/)}function f(){var t,n,r,o=[];for(g(),v(o);e.length&&"}"!=e.charAt(0)&&(t=T()||(n=void 0,r=void 0,n=s(),(r=y())?(v(),n({type:"rule",selectors:r,declarations:k()})):d("selector missing")));)!1!==t&&(o.push(t),v(o));return o}function h(t){var n=t.exec(e);if(n){var r=n[0];return a(r),e=e.slice(r.length),n}}function g(){h(/^\s*/)}function v(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=s();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return d("End of comment missing");var r=e.slice(2,n-2);return l+=2,a(r),e=e.slice(n),l+=2,t({type:"comment",comment:r})}}function y(){var e=h(/^([^{]+)/);if(e)return n(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function _(){var e=s(),r=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=n(r[0]),!h(/^:\s*/))return d("property missing ':'");var o=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(t,""),value:o?n(o[0]).replace(t,""):""});return h(/^[;\s]*/),i}}function k(){var e,t=[];if(!p())return d("missing '{'");for(v(t);e=_();)!1!==e&&(t.push(e),v(t));return m()?t:d("missing '}'")}function x(){for(var e,t=[],n=s();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:k()})}var w,C=I("import"),E=I("charset"),S=I("namespace");function I(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=s(),r=h(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function T(){if("@"==e[0])return function(){var e=s();if(t=h(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return d("@keyframes missing name");var r,o=t[1];if(!p())return d("@keyframes missing '{'");for(var i=v();r=x();)i.push(r),i=i.concat(v());return m()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):d("@keyframes missing '}'")}}()||function(){var e=s(),t=h(/^@media *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@media missing '{'");var o=v().concat(f());return m()?e({type:"media",media:r,rules:o}):d("@media missing '}'")}}()||function(){var e=s(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:n(t[1]),media:n(t[2])})}()||function(){var e=s(),t=h(/^@supports *([^{]+)/);if(t){var r=n(t[1]);if(!p())return d("@supports missing '{'");var o=v().concat(f());return m()?e({type:"supports",supports:r,rules:o}):d("@supports missing '}'")}}()||C()||E()||S()||function(){var e=s(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var r=n(t[1]),o=n(t[2]);if(!p())return d("@document missing '{'");var i=v().concat(f());return m()?e({type:"document",document:o,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=s();if(h(/^@page */)){var t=y()||[];if(!p())return d("@page missing '{'");for(var n,r=v();n=_();)r.push(n),r=r.concat(v());return m()?e({type:"page",selectors:t,declarations:r}):d("@page missing '}'")}}()||function(){var e=s();if(h(/^@host\s*/)){if(!p())return d("@host missing '{'");var t=v().concat(f());return m()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=s();if(h(/^@font-face\s*/)){if(!p())return d("@font-face missing '{'");for(var t,n=v();t=_();)n.push(t),n=n.concat(v());return m()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}return r((w=f(),{type:"stylesheet",stylesheet:{source:o.source,rules:w,parsingErrors:u}}))}},68829:function(e){function t(e){this.options=e||{}}e.exports=t,t.prototype.emit=function(e){return e},t.prototype.visit=function(e){return this[e.type](e)},t.prototype.mapVisit=function(e,t){var n="";t=t||"";for(var r=0,o=e.length;re.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(s+=c.count)}}var p=t[l-1];return l>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[l-2].value+=p.value,t.pop()),t}function o(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.callback;"function"==typeof n&&(i=n,n={}),this.options=n;var l=this;function a(e){return i?(setTimeout((function(){i(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var s=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=s+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=s&&m+1>=c)return a([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var i=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1=s&&f+1>=c)return a(r(l,i.components,t,e,l.useLongestToken));p[n]=i}else p[n]=void 0}u++}if(i)!function e(){setTimeout((function(){if(u>d)return i();f()||e()}),0)}();else for(;u<=d;){var h=f();if(h)return h}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var o=t.length,i=n.length,l=e.newPos,a=l-r,s=0;l+1t},ie64:function(){return b.ie()&&d},firefox:function(){return v()||n},opera:function(){return v()||r},webkit:function(){return v()||o},safari:function(){return b.webkit()},chrome:function(){return v()||i},windows:function(){return v()||s},osx:function(){return v()||a},linux:function(){return v()||c},iphone:function(){return v()||p},mobile:function(){return v()||p||m||u||h},nativeApp:function(){return v()||f},android:function(){return v()||u},ipad:function(){return v()||m}};e.exports=b},87305:function(e,t,n){"use strict";var r,o=n(23762);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var l=document.createElement("div");l.setAttribute(n,"return;"),i="function"==typeof l[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},42802:function(e,t,n){"use strict";var r=n(79775),o=n(87305);function i(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},74870:function(e,t,n){var r;e=n.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var l,a=2147483647,s=36,c=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,f=String.fromCharCode;function h(e){throw RangeError(p[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function v(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+f(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=s)e=m(e/35);return m(r+36*e/(e+38))}function x(e){var t,n,r,o,i,l,c,u,d,p,f,g=[],v=e.length,b=0,_=128,x=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&h("not-basic"),g.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=v&&h("invalid-input"),((u=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:s)>=s||u>m((a-b)/l))&&h("overflow"),b+=u*l,!(u<(d=c<=x?1:c>=x+26?26:c-x));c+=s)l>m(a/(p=s-d))&&h("overflow"),l*=p;x=k(b-i,t=g.length+1,0==i),m(b/t)>a-_&&h("overflow"),_+=m(b/t),b%=t,g.splice(b++,0,_)}return y(g)}function w(e){var t,n,r,o,i,l,c,u,d,p,g,v,y,x,w,C=[];for(v=(e=b(e)).length,t=128,n=0,i=72,l=0;l=t&&gm((a-n)/(y=r+1))&&h("overflow"),n+=(c-t)*y,t=c,l=0;la&&h("overflow"),g==t){for(u=n,d=s;!(u<(p=d<=i?1:d>=i+26?26:d-i));d+=s)w=u-p,x=s-p,C.push(f(_(p+w%x,0))),u=m(w/x);C.push(f(_(u,0))),i=k(n,y,r==o),n=0,++r}++n,++t}return C.join("")}l={version:"1.3.2",ucs2:{decode:b,encode:y},decode:x,encode:w,toASCII:function(e){return v(e,(function(e){return u.test(e)?"xn--"+w(e):e}))},toUnicode:function(e){return v(e,(function(e){return c.test(e)?x(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return l}.call(t,n,t,e))||(e.exports=r)}()},55240:function(e){"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,o){n=n||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var l=/\+/g;e=e.split(n);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var c=0;c=0?(u=f.substr(0,h),d=f.substr(h+1)):(u=f,d=""),p=decodeURIComponent(u),m=decodeURIComponent(d),t(i,p)?Array.isArray(i[p])?i[p].push(m):i[p]=[i[p],m]:i[p]=m}return i}},3907:function(e){"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,o){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(t(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(t(e))})).join(n):i+encodeURIComponent(t(e[o]))})).join(n):o?encodeURIComponent(t(o))+r+encodeURIComponent(t(e)):""}},54415:function(e,t,n){"use strict";t.decode=t.parse=n(55240),t.encode=t.stringify=n(3907)},36844:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:

foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var i={},l={},a={},s=o(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=!0);return t}()};function d(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",r={valid:!0,error:""};i.helper.isArray(e)||(e=[e]);for(var o=0;o").replace(/&/g,"&")};var m=function(e,t,n,r){"use strict";var o,i,l,a,s,c=r||"",u=c.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),p=new RegExp(t,c.replace(/g/g,"")),m=[];do{for(o=0;l=d.exec(e);)if(p.test(l[0]))o++||(a=(i=d.lastIndex)-l[0].length);else if(o&&!--o){s=l.index+l[0].length;var f={left:{start:a,end:i},match:{start:i,end:l.index},right:{start:l.index,end:s},wholeMatch:{start:a,end:s}};if(m.push(f),!u)return m}}while(o&&(d.lastIndex=i));return m};i.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=m(e,t,n,r),i=[],l=0;l0){var u=[];0!==a[0].wholeMatch.start&&u.push(e.slice(0,a[0].wholeMatch.start));for(var d=0;d=0?r+(n||0):r},i.helper.splitAtIndex=function(e,t){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},i.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e}))},i.helper.padEnd=function(e,t,n){"use strict";return t>>=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),i.helper.regexes={asteriskDashAndColon:/([*_:~])/g},i.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:"S"},i.Converter=function(e){"use strict";var t={},n=[],r=[],o={},l=c,p={parsed:{},raw:"",format:""};function m(e,t){if(t=t||null,i.helper.isString(e)){if(t=e=i.helper.stdExtName(e),i.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new i.Converter)),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var l=0;l[ \t]+¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var n=t.createElement("div");n.innerHTML=e;var r={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],r=0;r'}else n.push(t[r].innerHTML),t[r].innerHTML="",t[r].setAttribute("prenum",r.toString());return n}(n)};!function e(t){for(var n=0;n? ?(['"].*['"])?\)$/m)>-1)l="";else if(!l){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),l="#"+o,i.helper.isUndefined(n.gUrls[o]))return e;l=n.gUrls[o],i.helper.isUndefined(n.gTitles[o])||(c=n.gTitles[o])}var u='"+r+""};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,n,r,o,l){if("\\"===r)return n+o;if(!i.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var a=t.ghMentionsLink.replace(/\{u}/g,l),s="";return t.openLinksInNewWindow&&(s=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'"+o+""}))),n.converter._dispatch("anchors.after",e,t,n)}));var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,v=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,b=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,y=function(e){"use strict";return function(t,n,r,o,l,a,s){var c=r=r.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback),u="",d="",p=n||"",m=s||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(u=a),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'"+c+""+u+m}},_=function(e,t){"use strict";return function(n,r,o){var l="mailto:";return r=r||"",o=i.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(l=i.helper.encodeEmailAddress(l+o),o=i.helper.encodeEmailAddress(o)):l+=o,r+''+o+""}};i.subParser("autoLinks",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(g,y(t))).replace(b,_(t,n)),n.converter._dispatch("autoLinks.after",e,t,n)})),i.subParser("simplifiedAutoLinks",(function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(h,y(t)):e.replace(f,y(t))).replace(v,_(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e})),i.subParser("blockGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=i.subParser("blockQuotes")(e,t,n),e=i.subParser("headers")(e,t,n),e=i.subParser("horizontalRule")(e,t,n),e=i.subParser("lists")(e,t,n),e=i.subParser("codeBlocks")(e,t,n),e=i.subParser("tables")(e,t,n),e=i.subParser("hashHTMLBlocks")(e,t,n),e=i.subParser("paragraphs")(e,t,n),n.converter._dispatch("blockGamut.after",e,t,n)})),i.subParser("blockQuotes",(function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var r=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(r=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(r,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=i.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=i.subParser("blockGamut")(e,t,n)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*
[^\r]+?<\/pre>)/gm,(function(e,t){var n=t;return(n=n.replace(/^  /gm,"¨0")).replace(/¨0/g,"")})),i.subParser("hashBlock")("
\n"+e+"\n
",t,n)})),n.converter._dispatch("blockQuotes.after",e,t,n)})),i.subParser("codeBlocks",(function(e,t,n){"use strict";return e=n.converter._dispatch("codeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,r,o){var l=r,a=o,s="\n";return l=i.subParser("outdent")(l,t,n),l=i.subParser("encodeCode")(l,t,n),l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(s=""),l="
"+l+s+"
",i.subParser("hashBlock")(l,t,n)+a}))).replace(/¨0/,""),n.converter._dispatch("codeBlocks.after",e,t,n)})),i.subParser("codeSpans",(function(e,t,n){"use strict";return void 0===(e=n.converter._dispatch("codeSpans.before",e,t,n))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,r,o,l){var a=l;return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+""+(a=i.subParser("encodeCode")(a,t,n))+"",i.subParser("hashHTMLSpans")(a,t,n)})),n.converter._dispatch("codeSpans.after",e,t,n)})),i.subParser("completeHTMLDocument",(function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="\n",i="",l='\n',a="",s="";for(var c in void 0!==n.metadata.parsed.doctype&&(o="\n","html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(l='')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":i=""+n.metadata.parsed.title+"\n";break;case"charset":l="html"===r||"html5"===r?'\n':'\n';break;case"language":case"lang":a=' lang="'+n.metadata.parsed[c]+'"',s+='\n';break;default:s+='\n'}return e=o+"\n\n"+i+l+s+"\n\n"+e.trim()+"\n\n",n.converter._dispatch("completeHTMLDocument.after",e,t,n)})),i.subParser("detab",(function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var n=t,r=4-n.length%4,o=0;o/g,">"),n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)})),i.subParser("encodeBackslashEscapes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,i.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)})),i.subParser("encodeCode",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("encodeCode.before",e,t,n)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeCode.after",e,t,n)})),i.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)}))).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)})),n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)})),i.subParser("githubCodeBlocks",(function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,r,o,l){var a=t.omitExtraWLInCodeBlocks?"":"\n";return l=i.subParser("encodeCode")(l,t,n),l="
"+(l=(l=(l=i.subParser("detab")(l,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+a+"
",l=i.subParser("hashBlock")(l,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:l})-1)+"G\n\n"}))).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e})),i.subParser("hashBlock",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",n.converter._dispatch("hashBlock.after",e,t,n)})),i.subParser("hashCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,l){var a=o+i.subParser("encodeCode")(r,t,n)+l;return"¨C"+(n.gHtmlSpans.push(a)-1)+"C"}),"]*>","","gim"),n.converter._dispatch("hashCodeTags.after",e,t,n)})),i.subParser("hashElement",(function(e,t,n){"use strict";return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),"\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}})),i.subParser("hashHTMLBlocks",(function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var r=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,r,o){var i=e;return-1!==r.search(/\bmarkdown\b/)&&(i=r+n.converter.makeHtml(t)+o),"\n\n¨K"+(n.gHtmlBlocks.push(i)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var l=0;l]*>)","im"),c="<"+r[l]+"\\b[^>]*>",u="";-1!==(a=i.helper.regexIndexOf(e,s));){var d=i.helper.splitAtIndex(e,a),p=i.helper.replaceRecursiveRegExp(d[1],o,c,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),e=(e=i.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),n.converter._dispatch("hashHTMLBlocks.after",e,t,n)})),i.subParser("hashHTMLSpans",(function(e,t,n){"use strict";function r(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,(function(e){return r(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<[^>]+?>/gi,(function(e){return r(e)})),n.converter._dispatch("hashHTMLSpans.after",e,t,n)})),i.subParser("unhashHTMLSpans",(function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r]*>\\s*]*>","^ {0,3}\\s*
","gim"),n.converter._dispatch("hashPreCodeTags.after",e,t,n)})),i.subParser("headers",(function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var r=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,l=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c=""+l+"";return i.subParser("hashBlock")(c,t,n)}))).replace(l,(function(e,o){var l=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+s(o)+'"',c=r+1,u=""+l+"";return i.subParser("hashBlock")(u,t,n)}));var a=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function s(e){var r,o;if(t.customizedHeaderId){var l=e.match(/\{([^{]+?)}\s*$/);l&&l[1]&&(e=l[1])}return r=e,o=i.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(r=o+r),r=t.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():r.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(r=o+r),n.hashLinkCounts[r]?r=r+"-"+n.hashLinkCounts[r]++:n.hashLinkCounts[r]=1,r}return e=e.replace(a,(function(e,o,l){var a=l;t.customizedHeaderId&&(a=l.replace(/\s?\{([^{]+?)}\s*$/,""));var c=i.subParser("spanGamut")(a,t,n),u=t.noHeaderId?"":' id="'+s(l)+'"',d=r-1+o.length,p=""+c+"";return i.subParser("hashBlock")(p,t,n)})),n.converter._dispatch("headers.after",e,t,n)})),i.subParser("horizontalRule",(function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var r=i.subParser("hashBlock")("
",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,r),n.converter._dispatch("horizontalRule.after",e,t,n)})),i.subParser("images",(function(e,t,n){"use strict";function r(e,t,r,o,l,a,s,c){var u=n.gUrls,d=n.gTitles,p=n.gDimensions;if(r=r.toLowerCase(),c||(c=""),e.search(/\(? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==r&&null!==r||(r=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,i.helper.isUndefined(u[r]))return e;o=u[r],i.helper.isUndefined(d[r])||(c=d[r]),i.helper.isUndefined(p[r])||(l=p[r].width,a=p[r].height)}t=t.replace(/"/g,""").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback);var m=''+t+'"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,n,o,i,l,a,s){return r(e,t,n,o=o.replace(/\s/g,""),i,l,0,s)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,r)).replace(/!\[([^\[\]]+)]()()()()()/g,r),n.converter._dispatch("images.after",e,t,n)})),i.subParser("italicsAndBold",(function(e,t,n){"use strict";function r(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return r(t,"","")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return r(t,"","")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return r(t,"","")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"","")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"","")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"","")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"",""):e})),n.converter._dispatch("italicsAndBold.after",e,t,n)})),i.subParser("lists",(function(e,t,n){"use strict";function r(e,r){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,l=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,r,o,a,s,c,u){u=u&&""!==u.trim();var d=i.subParser("outdent")(s,t,n),p="";return c&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),r||d.search(/\n{2,}/)>-1?(d=i.subParser("githubCodeBlocks")(d,t,n),d=i.subParser("blockGamut")(d,t,n)):(d=(d=i.subParser("lists")(d,t,n)).replace(/\n$/,""),d=(d=i.subParser("hashHTMLBlocks")(d,t,n)).replace(/\n\n+/g,"\n\n"),d=l?i.subParser("paragraphs")(d,t,n):i.subParser("spanGamut")(d,t,n)),""+(d=d.replace("¨A",""))+"\n"}))).replace(/¨0/g,""),n.gListLevel--,r&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function l(e,n,i){var l=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,a=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,s="ul"===n?l:a,c="";if(-1!==e.search(s))!function t(u){var d=u.search(s),p=o(e,n);-1!==d?(c+="\n\n<"+n+p+">\n"+r(u.slice(0,d),!!i)+"\n",s="ul"==(n="ul"===n?"ol":"ul")?l:a,t(u.slice(d))):c+="\n\n<"+n+p+">\n"+r(u,!!i)+"\n"}(e);else{var u=o(e,n);c="\n\n<"+n+u+">\n"+r(e,!!i)+"\n"}return c}return e=n.converter._dispatch("lists.before",e,t,n),e+="¨0",e=(e=n.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n){return l(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n,r){return l(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),n.converter._dispatch("lists.after",e,t,n)})),i.subParser("metadata",(function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,r){return n.metadata.parsed[t]=r,""}))}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,n){return r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"}))).replace(/¨M/g,""),n.converter._dispatch("metadata.after",e,t,n)})),i.subParser("outdent",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),n.converter._dispatch("outdent.after",e,t,n)})),i.subParser("paragraphs",(function(e,t,n){"use strict";for(var r=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],l=r.length,a=0;a=0?o.push(s):s.search(/\S/)>=0&&(s=(s=i.subParser("spanGamut")(s,t,n)).replace(/^([ \t]*)/g,"

"),s+="

",o.push(s))}for(l=o.length,a=0;a]*>\s*]*>/.test(u)&&(d=!0)}o[a]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)})),i.subParser("runExtension",(function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),i.subParser("spanGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=i.subParser("codeSpans")(e,t,n),e=i.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=i.subParser("encodeBackslashEscapes")(e,t,n),e=i.subParser("images")(e,t,n),e=i.subParser("anchors")(e,t,n),e=i.subParser("autoLinks")(e,t,n),e=i.subParser("simplifiedAutoLinks")(e,t,n),e=i.subParser("emoji")(e,t,n),e=i.subParser("underline")(e,t,n),e=i.subParser("italicsAndBold")(e,t,n),e=i.subParser("strikethrough")(e,t,n),e=i.subParser("ellipsis")(e,t,n),e=i.subParser("hashHTMLSpans")(e,t,n),e=i.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
\n")):e=e.replace(/ +\n/g,"
\n"),n.converter._dispatch("spanGamut.after",e,t,n)})),i.subParser("strikethrough",(function(e,t,n){"use strict";return t.strikethrough&&(e=(e=n.converter._dispatch("strikethrough.before",e,t,n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,r){return function(e){return t.simplifiedAutoLink&&(e=i.subParser("simplifiedAutoLinks")(e,t,n)),""+e+""}(r)})),e=n.converter._dispatch("strikethrough.after",e,t,n)),e})),i.subParser("stripLinkDefinitions",(function(e,t,n){"use strict";var r=function(e,r,o,l,a,s,c){return r=r.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?n.gUrls[r]=o.replace(/\s/g,""):n.gUrls[r]=i.subParser("encodeAmpsAndAngles")(o,t,n),s?s+c:(c&&(n.gTitles[r]=c.replace(/"|'/g,""")),t.parseImgDimensions&&l&&a&&(n.gDimensions[r]={width:l,height:a}),"")};return(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,r)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,r)).replace(/¨0/,"")})),i.subParser("tables",(function(e,t,n){"use strict";if(!t.tables)return e;function r(e,r){return""+i.subParser("spanGamut")(e,t,n)+"\n"}function o(e){var o,l=e.split("\n");for(o=0;o"+(s=i.subParser("spanGamut")(s,t,n))+"\n"));for(o=0;o\n\n\n",o=0;o\n";for(var i=0;i\n"}return n+"\n\n"}(f,g)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,i.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),n.converter._dispatch("tables.after",e,t,n)})),i.subParser("underline",(function(e,t,n){"use strict";return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return""+t+""}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return""+t+""})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?""+t+"":e}))).replace(/(_)/g,i.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e})),i.subParser("unescapeSpecialChars",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,(function(e,t){var n=parseInt(t);return String.fromCharCode(n)})),n.converter._dispatch("unescapeSpecialChars.after",e,t,n)})),i.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,l=0;l "+(n=n.trim()).split("\n").join("\n> ")})),i.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"})),i.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),i.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,o=r.length,l=0;l",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),i.subParser("makeMarkdown.links",(function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,o=r.length;n="[";for(var l=0;l",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n})),i.subParser("makeMarkdown.list",(function(e,t,n){"use strict";var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,l=o.length,a=e.getAttribute("start")||1,s=0;s"+t.preList[n]+""})),i.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,o=r.length,l=0;ltr>th"),s=e.querySelectorAll("tbody>tr");for(n=0;nf&&(f=h)}for(n=0;n/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")})),void 0===(r=function(){"use strict";return i}.call(t,n,t,e))||(e.exports=r)}).call(this)},14471:function(e,t,n){var r=n(89504),o=n(3040),i=n(439),l=n(20242);function a(){return Array.prototype.reduce.call(arguments,(function(e,t){return o.resolve(e,t)}))}function s(e){return"\\"===i.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return l(e.replace(/\+/g,"%2B"))}function u(e,t,n){setImmediate((function(){e(t,n)}))}function d(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function p(e,t,n){var r=c(t);try{return String(e(r))}catch(e){throw e.sourceMapData=n,e}}var m=/[#@] sourceMappingURL=([^\s'"]*)/,f=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+m.source+")\\s*\\*/|//(?:"+m.source+"))\\s*");function h(e,t,n,r){var o;try{o=y(e,t)}catch(e){return u(r,e)}if(!o||o.map)return u(r,null,o);n(c(o.url),(function(e,t){if(e)return e.sourceMapData=o,r(e);o.map=String(t);try{o.map=d(o.map,o)}catch(e){return r(e)}r(null,o)}))}function g(e,t,n){var r=y(e,t);return!r||r.map||(r.map=p(n,r.url,r),r.map=d(r.map,r)),r}var v=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,b=/^(?:application|text)\/json$/;function y(e,t){t=s(t);var n=function(e){var t=e.match(f);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var o=n.match(v);if(o){var i=o[1]||"text/plain",l=o[2]||"",c=o[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!b.test(i)){var p=new Error("Unuseful data uri mime type: "+i);throw p.sourceMapData=u,p}try{u.map=d(";base64"===l?function(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return r(e);var t=function(e){for(var t=r(e),n=t.length,o=new Uint8Array(n),i=0;i=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},l.prototype.at=function(e){if(e>=0&&e>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,l,a,s=e.length,c=0,u=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<>1,1==(1&l)?-a:a),n.rest=t}},8407:function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e0?r-s>1?n(s,r,o,i,l,a):a==t.LEAST_UPPER_BOUND?r1?n(e,s,o,i,l,a):a==t.LEAST_UPPER_BOUND?s:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var l=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(l<0)return-1;for(;l-1>=0&&0===o(r[l],r[l-1],!0);)--l;return l}},3307:function(e,t,n){var r=n(23114);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,l,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,l=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=l||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},14116:function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o=0){var a=this._originalMappings[l];if(void 0===e.column)for(var s=a.originalLine;a&&a.originalLine===s;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++l]}return i},t.SourceMapConsumer=s,c.prototype=Object.create(s.prototype),c.prototype.consumer=s,c.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t1&&(n.source=h+i[1],h+=i[1],n.originalLine=m+i[2],m=n.originalLine,n.originalLine+=1,n.originalColumn=f+i[3],f=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),x.push(n),"number"==typeof n.originalLine&&k.push(n)}a(x,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=x,a(k,r.compareByOriginalPositions),this.__originalMappings=k},c.prototype._findMapping=function(e,t,n,r,i,l){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,l)},c.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=r.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var l=r.getArg(o,"name",null);return null!==l&&(l=this._names.at(l)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:l}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){var l=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(l))return this.sourcesContent[this._sources.indexOf(l)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",s.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(s.prototype),d.prototype.constructor=s,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,l=0,a=1,s=0,c=0,u=0,d=0,p="",m=this._mappings.toArray(),f=0,h=m.length;f0){if(!o.compareByGeneratedPositionsInflated(t,m[f-1]))continue;e+=","}e+=r.encode(t.generatedColumn-l),l=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},a.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},25421:function(e,t,n){var r=n(67819).SourceMapGenerator,o=n(23114),i=/(\r?\n)/,l="$$$isSourceNode$$$";function a(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[l]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,l=e.split(i),s=0,c=function(){return e()+(e()||"");function e(){return s=0;t--)this.prepend(e[t]);else{if(!e[l]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n=0;u--)"."===(l=s[u])?s.splice(u,1):".."===l?c++:c>0&&(""===l?(s.splice(u+1,c),c=0):(s.splice(u,2),c--));return""===(n=s.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:l(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}t.urlParse=o,t.urlGenerate=i,t.normalize=l,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=s?c:function(e){return u(e)?"$"+e:e},t.fromSetString=s?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=d(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var s=r.path.lastIndexOf("/");s>=0&&(r.path=r.path.substring(0,s+1))}t=a(i(r),t)}return l(t)}},20065:function(e,t,n){t.SourceMapGenerator=n(67819).SourceMapGenerator,t.SourceMapConsumer=n(22799).SourceMapConsumer,n(25421)},28771:function(e){"use strict";function t(e){return Object.prototype.toString.call(e)}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),d=["%","/","?",";","#"].concat(u),p=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(54415);function y(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i127?A+="x":A+=P[D];if(!A.match(m)){var M=B.slice(0,I),O=B.slice(I+1),Z=P.match(f);Z&&(M.push(Z[1]),O.unshift(Z[2])),O.length&&(y="/"+O.join(".")+y),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+F,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!h[x])for(I=0,L=u.length;I0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===E||".."===E)||""===E,I=0,T=w.length;T>=0;T--)"."===(E=w[T])?w.splice(T,1):".."===E?(w.splice(T,1),I++):I&&(w.splice(T,1),I--);if(!k&&!x)for(;I--;I)w.unshift("..");!k||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var N,B=""===w[0]||w[0]&&"/"===w[0].charAt(0);return C&&(n.hostname=n.host=B?"":w.length?w.shift():"",(N=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=N.shift(),n.host=n.hostname=N.shift())),(k=k||n.host&&w.length)&&!B&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},54783:function(e){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},65311:function(e){"use strict";e.exports=jQuery},37019:function(){},96344:function(){},439:function(){}},function(e){e.O(0,[351],(function(){return 14477,e(e.s=14477)})),e.O()}]);