Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Dismiss keyboard button #61

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jan 18, 2025

Related:

What?

Add a button dedicated to dismissing the virtual keyboard.

Why?

An explicit button for dismissing the keyboard allows users to view the
entirety of the post content without the virtual keyboard blocking a
portion of the content.

How?

Add a block toolbar button that is conditionally displayed depending on whether
the virtual keyboard visibility. As there is little-to-no VirtualKeyboard API
support in browsers, we rely upon focus and blur events to provide a best guess.

Testing Instructions

  1. Insert or select a text block.
  2. Tap the dismiss keyboard button.
  3. Verify the virtual keyboard closes and the block is deselected.
  4. Insert or select a non-text block.
  5. Verify the dismiss keyboard button is not displayed.

Accessibility Testing Instructions

Verify the dismiss keyboard button has a helpful label.

Screenshots or screencast

iOS Android
ios-dismiss-keyboard android-dismiss-keyboard

An explicit button for dismissing the keyboard allows users to view the
entirety of the post content without the virtual keyboard blocking a
portion of the content.
@dcalhoun dcalhoun added the enhancement New feature or request label Jan 18, 2025
@dcalhoun dcalhoun marked this pull request as ready for review January 18, 2025 17:35
@dcalhoun dcalhoun requested a review from kean January 18, 2025 17:35
@nbradbury
Copy link

@dcalhoun This seems to be working great, with one exception: if I dismiss the keyboard using the Back arrow in the bottom nav bar, the new keyboard button continues to appear until I tap on it:

keyboard.mp4

Also, given that the bottom Back arrow dismisses the keyboard, is this new button necessary? Perhaps we have this new button in case the user doesn't realize the back arrow closes the keyboard?

@dcalhoun
Copy link
Member Author

if I dismiss the keyboard using the Back arrow in the bottom nav bar, the new keyboard button continues to appear until I tap on it:

Also, given that the bottom Back arrow dismisses the keyboard, is this new button necessary? Perhaps we have this new button in case the user doesn't realize the back arrow closes the keyboard?

@nbradbury ah, good catch on the hardware back button oddity. I implemented the dismiss keyboard button on Android because it was present in Gutenberg Mobile. However, you make a good point that it is somewhat superfluous given how the hardware back button dismisses the virtual keyboard. I suppose the button is far more useful on iOS, which lacks a hardware back button.

Given Android's back button and the current shortcoming of the dedicated dismiss keyboard button lingering, it might make more sense to forgo the dedicated button on Android. WDYT?

I will ask one question: Is the hardware back button's presence and behavior universal? I.e., will it always be available for users on various devices?

@nbradbury
Copy link

Is the hardware back button's presence and behavior universal? I.e., will it always be available for users on various devices?

Given the number of Android manufacturers and devices, I'd be hard-pressed to answer that with 100% certainty. But I do note that on both my Google and Samsung devices, the back button is present and dismisses the keyboard.

it might make more sense to forgo the dedicated button on Android. WDYT?

I agree.

Given the vast majority of Android devices have dedicated back buttons
that dismiss the keyboard, a dedicated software button in the editor
feels superfluous.
@dcalhoun dcalhoun force-pushed the feat/dismiss-keyboard branch from 1622b37 to fc14666 Compare January 21, 2025 16:56
@dcalhoun
Copy link
Member Author

Given the number of Android manufacturers and devices, I'd be hard-pressed to answer that with 100% certainty. But I do note that on both my Google and Samsung devices, the back button is present and dismisses the keyboard.

Fair enough. 😅

From a bit of research, it appears Android has a Compatibility Definition Document where it outlines requirements for Android device compatibility, including navigation functions. It seems back function buttons are recommended, but not required; it is recognized there may be valid reasons for excluding back function buttons, albeit for particular circumstances.

The Home, Recents, and Back functions typically provided via an interaction with a dedicated physical button or a distinct portion of the touch screen, are essential to the Android navigation paradigm and therefore, device implementations:

Given the aforementioned Android suggestion and the shortcoming of the proposed dismiss keyboard button implementation—which would likely require explicit bridge communication to address—my thought is we should forgo the dedicated dismiss keyboard button. I implemented an Android exclusion.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DB9nabmU.js","./index-CkUrYNsQ.css"])))=>i.map(i=>d[i]);
import fe from"@wordpress/block-editor/build-style/default-editor-styles.css?inline";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();const pe="modulepreload",he=function(e,t){return new URL(e,t).href},N={},we=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=Promise.allSettled(r.map(l=>{if(l=he(l,n),l in N)return;N[l]=!0;const w=l.endsWith(".css"),o=w?'[rel="stylesheet"]':"";if(!!n)for(let _=a.length-1;_>=0;_--){const f=a[_];if(f.href===l&&(!w||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${o}`))return;const h=document.createElement("link");if(h.rel=w?"stylesheet":pe,w||(h.as="script"),h.crossOrigin="",h.href=l,d&&h.setAttribute("nonce",d),document.head.appendChild(h),w)return new Promise((_,f)=>{h.addEventListener("load",_),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var C={},z;function ge(){return z||(z=1,function(e){(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(c){return i(a(c),arguments)}function n(c,d){return r.apply(null,[c].concat(d||[]))}function i(c,d){var l=1,w=c.length,o,y="",h,_,f,A,S,P,O,u;for(h=0;h<w;h++)if(typeof c[h]=="string")y+=c[h];else if(typeof c[h]=="object"){if(f=c[h],f.keys)for(o=d[l],_=0;_<f.keys.length;_++){if(o==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[_],f.keys[_-1]));o=o[f.keys[_]]}else f.param_no?o=d[f.param_no]:o=d[l++];if(t.not_type.test(f.type)&&t.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(r("[sprintf] expecting number but found %T",o));switch(t.number.test(f.type)&&(O=o>=0),f.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,f.width?parseInt(f.width):0);break;case"e":o=f.precision?parseFloat(o).toExponential(f.precision):parseFloat(o).toExponential();break;case"f":o=f.precision?parseFloat(o).toFixed(f.precision):parseFloat(o);break;case"g":o=f.precision?String(Number(o.toPrecision(f.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=f.precision?o.substring(0,f.precision):o;break;case"t":o=String(!!o),o=f.precision?o.substring(0,f.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=f.precision?o.substring(0,f.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=f.precision?o.substring(0,f.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(f.type)?y+=o:(t.number.test(f.type)&&(!O||f.sign)?(u=O?"+":"-",o=o.toString().replace(t.sign,"")):u="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",P=f.width-(u+o).length,A=f.width&&P>0?S.repeat(P):"",y+=f.align?u+o+A:S==="0"?u+A+o:A+u+o)}return y}var s=Object.create(null);function a(c){if(s[c])return s[c];for(var d=c,l,w=[],o=0;d;){if((l=t.text.exec(d))!==null)w.push(l[0]);else if((l=t.modulo.exec(d))!==null)w.push("%");else if((l=t.placeholder.exec(d))!==null){if(l[2]){o|=1;var y=[],h=l[2],_=[];if((_=t.key.exec(h))!==null)for(y.push(_[1]);(h=h.substring(_[0].length))!=="";)if((_=t.key_access.exec(h))!==null)y.push(_[1]);else if((_=t.index_access.exec(h))!==null)y.push(_[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=y}else o|=2;if(o===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");w.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return s[c]=w}e.sprintf=r,e.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()}(C)),C}ge();var H,re,T,ne;H={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};re=["(","?"];T={")":["("],":":["?","?:"]};ne=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function ye(e){for(var t=[],r=[],n,i,s,a;n=e.match(ne);){for(i=n[0],s=e.substr(0,n.index).trim(),s&&t.push(s);a=r.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(re.indexOf(a)>=0||H[a]<H[i]){r.push(a);break}t.push(a)}T[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var me={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function _e(e,t){var r=[],n,i,s,a,c,d;for(n=0;n<e.length;n++){if(c=e[n],a=me[c],a){for(i=a.length,s=Array(i);i--;)s[i]=r.pop();try{d=a.apply(null,s)}catch(l){return l}}else t.hasOwnProperty(c)?d=t[c]:d=+c;r.push(d)}return r[0]}function be(e){var t=ye(e);return function(r){return _e(t,r)}}function ve(e){var t=be(e);return function(r){return+t({n:r})}}var q={contextDelimiter:"",onMissingKey:null};function Ee(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function j(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in q)this.options[r]=t!==void 0&&r in t?t[r]:q[r]}j.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,s;return r||(n=this.data[e][""],s=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof s!="function"&&(i=Ee(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),s=ve(i)),r=this.pluralForms[e]=s),r(t)};j.prototype.dcnpgettext=function(e,t,r,n,i){var s,a,c;return i===void 0?s=0:s=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),c=this.data[e][a],c&&c[s]?c[s]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),s===0?r:n)};const K={"":{plural_forms(e){return e===1?0:1}}},xe=/^i18n\.(n?gettext|has_translation)(_|$)/,Ae=(e,t,r)=>{const n=new j({}),i=new Set,s=()=>{i.forEach(u=>u())},a=u=>(i.add(u),()=>i.delete(u)),c=(u="default")=>n.data[u],d=(u,p="default")=>{n.data[p]={...n.data[p],...u},n.data[p][""]={...K[""],...n.data[p]?.[""]},delete n.pluralForms[p]},l=(u,p)=>{d(u,p),s()},w=(u,p="default")=>{n.data[p]={...n.data[p],...u,"":{...K[""],...n.data[p]?.[""],...u?.[""]}},delete n.pluralForms[p],s()},o=(u,p)=>{n.data={},n.pluralForms={},l(u,p)},y=(u="default",p,g,v,E)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,g,v,E)),h=(u="default")=>u,_=(u,p)=>{let g=y(p,void 0,u);return r?(g=r.applyFilters("i18n.gettext",g,u,p),r.applyFilters("i18n.gettext_"+h(p),g,u,p)):g},f=(u,p,g)=>{let v=y(g,p,u);return r?(v=r.applyFilters("i18n.gettext_with_context",v,u,p,g),r.applyFilters("i18n.gettext_with_context_"+h(g),v,u,p,g)):v},A=(u,p,g,v)=>{let E=y(v,void 0,u,p,g);return r?(E=r.applyFilters("i18n.ngettext",E,u,p,g,v),r.applyFilters("i18n.ngettext_"+h(v),E,u,p,g,v)):E},S=(u,p,g,v,E)=>{let k=y(E,v,u,p,g);return r?(k=r.applyFilters("i18n.ngettext_with_context",k,u,p,g,v,E),r.applyFilters("i18n.ngettext_with_context_"+h(E),k,u,p,g,v,E)):k},P=()=>f("ltr","text direction")==="rtl",O=(u,p,g)=>{const v=p?p+""+u:u;let E=!!n.data?.[g??"default"]?.[v];return r&&(E=r.applyFilters("i18n.has_translation",E,u,p,g),E=r.applyFilters("i18n.has_translation_"+h(g),E,u,p,g)),E};if(r){const u=p=>{xe.test(p)&&s()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:c,setLocaleData:l,addLocaleData:w,resetLocaleData:o,subscribe:a,__:_,_x:f,_n:A,_nx:S,isRTL:P,hasTranslation:O}};function ie(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function U(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function B(e,t){return function(n,i,s,a=10){const c=e[t];if(!U(n)||!ie(i))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:s,priority:a,namespace:i};if(c[n]){const l=c[n].handlers;let w;for(w=l.length;w>0&&!(a>=l[w-1].priority);w--);w===l.length?l[w]=d:l.splice(w,0,d),c.__current.forEach(o=>{o.name===n&&o.currentIndex>=w&&o.currentIndex++})}else c[n]={handlers:[d],runs:0};n!=="hookAdded"&&e.doAction("hookAdded",n,i,s,a)}}function D(e,t,r=!1){return function(i,s){const a=e[t];if(!U(i)||!r&&!ie(s))return;if(!a[i])return 0;let c=0;if(r)c=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===s&&(d.splice(l,1),c++,a.__current.forEach(w=>{w.name===i&&w.currentIndex>=l&&w.currentIndex--}))}return i!=="hookRemoved"&&e.doAction("hookRemoved",i,s),c}}function G(e,t){return function(n,i){const s=e[t];return typeof i<"u"?n in s&&s[n].handlers.some(a=>a.namespace===i):n in s}}function M(e,t,r,n){return function(s,...a){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const d=c[s].handlers;if(!d||!d.length)return r?a[0]:void 0;const l={name:s,currentIndex:0};async function w(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=await d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}function o(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}return(n?w:o)()}}function Q(e,t){return function(){var n;const i=e[t];return(n=Array.from(i.__current).at(-1)?.name)!==null&&n!==void 0?n:null}}function J(e,t){return function(n){const i=e[t];return typeof n>"u"?i.__current.size>0:Array.from(i.__current).some(s=>s.name===n)}}function X(e,t){return function(n){const i=e[t];if(U(n))return i[n]&&i[n].runs?i[n].runs:0}}class Se{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=B(this,"actions"),this.addFilter=B(this,"filters"),this.removeAction=D(this,"actions"),this.removeFilter=D(this,"filters"),this.hasAction=G(this,"actions"),this.hasFilter=G(this,"filters"),this.removeAllActions=D(this,"actions",!0),this.removeAllFilters=D(this,"filters",!0),this.doAction=M(this,"actions",!1,!1),this.doActionAsync=M(this,"actions",!1,!0),this.applyFilters=M(this,"filters",!0,!1),this.applyFiltersAsync=M(this,"filters",!0,!0),this.currentAction=Q(this,"actions"),this.currentFilter=Q(this,"filters"),this.doingAction=J(this,"actions"),this.doingFilter=J(this,"filters"),this.didAction=X(this,"actions"),this.didFilter=X(this,"filters")}}function Pe(){return new Se}const Oe=Pe(),b=Ae(void 0,void 0,Oe);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);const L=b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);function Te(e){const t=(r,n)=>{const{headers:i={}}=r;for(const s in i)if(s.toLowerCase()==="x-wp-nonce"&&i[s]===t.nonce)return n(r);return n({...r,headers:{...i,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const se=(e,t)=>{let r=e.path,n,i;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(n=e.namespace.replace(/^\/|\/$/g,""),i=e.endpoint.replace(/^\//,""),i?r=n+"/"+i:r=n),delete e.namespace,delete e.endpoint,t({...e,path:r})},Re=e=>(t,r)=>se(t,n=>{let i=n.url,s=n.path,a;return typeof s=="string"&&(a=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof a=="string"&&a.indexOf("?")!==-1&&(s=s.replace("?","&")),i=a+s),r({...n,url:i})});function ke(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ae(e){let t="";const r=Object.entries(e);let n;for(;n=r.shift();){let[i,s]=n;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[d,l]of c)r.unshift([`${i}[${d}]`,l])}else s!==void 0&&(s===null&&(s=""),t+="&"+[i,s].map(encodeURIComponent).join("="))}return t.substr(1)}function De(e){try{return decodeURIComponent(e)}catch{return e}}function Me(e,t,r){const n=t.length,i=n-1;for(let s=0;s<n;s++){let a=t[s];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;const c=!isNaN(Number(t[s+1]));e[a]=s===i?r:e[a]||(c?[]:{}),Array.isArray(e[a])&&!c&&(e[a]={...e[a]}),e=e[a]}}function F(e){return(ke(e)||"").replace(/\+/g,"%20").split("&").reduce((t,r)=>{const[n,i=""]=r.split("=").filter(Boolean).map(De);if(n){const s=n.replace(/\]/g,"").split("[");Me(t,s,i)}return t},Object.create(null))}function x(e="",t){if(!t||!Object.keys(t).length)return e;let r=e;const n=e.indexOf("?");return n!==-1&&(t=Object.assign(F(e),t),r=r.substr(0,n)),r+"?"+ae(t)}function I(e,t){return F(e)[t]}function V(e,t){return I(e,t)!==void 0}function Z(e,...t){const r=e.indexOf("?");if(r===-1)return e;const n=F(e),i=e.substr(0,r);t.forEach(a=>delete n[a]);const s=ae(n);return s?i+"?"+s:i}function W(e){const t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map(i=>i.split("=")).map(i=>i.map(decodeURIComponent)).sort((i,s)=>i[0].localeCompare(s[0])).map(i=>i.map(encodeURIComponent)).map(i=>i.join("=")).join("&"):n}function Le(e){const t=Object.fromEntries(Object.entries(e).map(([r,n])=>[W(r),n]));return(r,n)=>{const{parse:i=!0}=r;let s=r.path;if(!s&&r.url){const{rest_route:d,...l}=F(r.url);typeof d=="string"&&(s=x(d,l))}if(typeof s!="string")return n(r);const a=r.method||"GET",c=W(s);if(a==="GET"&&t[c]){const d=t[c];return delete t[c],Y(d,!!i)}else if(a==="OPTIONS"&&t[a]&&t[a][c]){const d=t[a][c];return delete t[a][c],Y(d,!!i)}return n(r)}}function Y(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const Fe=({path:e,url:t,...r},n)=>({...r,url:t&&x(t,n),path:e&&x(e,n)}),ee=e=>e.json?e.json():Promise.reject(e),Ce=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},te=e=>{const{next:t}=Ce(e.headers.get("link"));return t},He=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,r=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||r},oe=async(e,t)=>{if(e.parse===!1||!He(e))return t(e);const r=await m({...Fe(e,{per_page:100}),parse:!1}),n=await ee(r);if(!Array.isArray(n))return n;let i=te(r);if(!i)return n;let s=[].concat(n);for(;i;){const a=await m({...e,path:void 0,url:i,parse:!1}),c=await ee(a);s=s.concat(c),i=te(a)}return s},Ie=new Set(["PATCH","PUT","DELETE"]),je="GET",Ue=(e,t)=>{const{method:r=je}=e;return Ie.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},$e=(e,t)=>(typeof e.url=="string"&&!V(e.url,"_locale")&&(e.url=x(e.url,{_locale:"user"})),typeof e.path=="string"&&!V(e.path,"_locale")&&(e.path=x(e.path,{_locale:"user"})),t(e)),Ne=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,ze=e=>{const t={code:"invalid_json",message:L("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},ce=(e,t=!0)=>Promise.resolve(Ne(e,t)).catch(r=>$(r,t));function $(e,t=!0){if(!t)throw e;return ze(e).then(r=>{const n={code:"unknown_error",message:L("An unknown error occurred.")};throw r||n})}function qe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const Ke=(e,t)=>{if(!qe(e))return t(e);let r=0;const n=5,i=s=>(r++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>r<n?i(s):(t({path:`/wp/v2/media/${s}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(s=>{if(!s.headers)return Promise.reject(s);const a=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&a?i(a).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:L("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):$(s,e.parse)}).then(s=>ce(s,e.parse))},Be=e=>(t,r)=>{if(typeof t.url=="string"){const n=I(t.url,"wp_theme_preview");n===void 0?t.url=x(t.url,{wp_theme_preview:e}):n===""&&(t.url=Z(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const n=I(t.path,"wp_theme_preview");n===void 0?t.path=x(t.path,{wp_theme_preview:e}):n===""&&(t.path=Z(t.path,"wp_theme_preview"))}return r(t)},Ge={Accept:"application/json, */*;q=0.1"},Qe={credentials:"include"},le=[$e,se,Ue,oe];function Je(e){le.unshift(e)}const ue=e=>{if(e.status>=200&&e.status<300)return e;throw e},Xe=e=>{const{url:t,path:r,data:n,parse:i=!0,...s}=e;let{body:a,headers:c}=e;return c={...Ge,...c},n&&(a=JSON.stringify(n),c["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,{...Qe,...s,body:a,headers:c}).then(l=>Promise.resolve(l).then(ue).catch(w=>$(w,i)).then(w=>ce(w,i)),l=>{throw l&&l.name==="AbortError"?l:{code:"fetch_error",message:L("You are probably offline.")}})};let de=Xe;function Ve(e){de=e}function m(e){return le.reduceRight((r,n)=>i=>n(i,r),de)(e).catch(r=>r.code!=="rest_cookie_invalid_nonce"?Promise.reject(r):window.fetch(m.nonceEndpoint).then(ue).then(n=>n.text()).then(n=>(m.nonceMiddleware.nonce=n,m(e))))}m.use=Je;m.setFetchHandler=Ve;m.createNonceMiddleware=Te;m.createPreloadingMiddleware=Le;m.createRootURLMiddleware=Re;m.fetchAllMiddleware=oe;m.mediaUploadMiddleware=Ke;m.createThemePreviewMiddleware=Be;function ut(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function dt(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function ft(e,t){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(e,t),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:e,hasRedo:t}})}function pt(e){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(e)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:e})}function R(){if(window.GBKit)return window.GBKit;if(window.editorDelegate)try{return JSON.parse(window.editorDelegate.getEditorConfiguration())}catch{return{}}try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function Ze(){const{post:e}=R();return e?{id:e.id,title:{raw:decodeURIComponent(e.title)},content:{raw:decodeURIComponent(e.content)},type:e.type||"post"}:{type:"post",status:"draft",id:-1}}function We(){const{siteApiRoot:e="",authHeader:t}=R();m.use(m.createRootURLMiddleware(e)),m.use(Ye),m.use(et),m.use(tt(t)),m.use(rt),m.use(nt),m.use(m.createPreloadingMiddleware({"/wp/v2/types?context=view":{body:{post:{description:"",hierarchical:!1,has_archive:!1,name:"Posts",slug:"post",taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}},page:{description:"",hierarchical:!0,has_archive:!1,name:"Pages",slug:"page",taxonomies:[],rest_base:"pages",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}}}},"/wp/v2/types/post?context=edit":{body:{name:"Posts",slug:"post",supports:{title:!0,editor:!0,author:!0,thumbnail:!0,excerpt:!0,trackbacks:!0,"custom-fields":!0,comments:!0,revisions:!0,"post-formats":!0,autosave:!0},taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1}}}))}function Ye(e,t){return e.mode="cors",delete e.headers["x-wp-api-fetch-from-editor"],t(e)}function et(e,t){const{siteApiNamespace:r}=R();return e.path&&r&&!e.path.includes(r)&&(e.path=e.path.replace(/^(?<apiPath>\/?(?:[\w.-]+\/){2})/,`$<apiPath>${r}/`)),t(e)}function tt(e){return(t,r)=>(t.headers=t.headers||{},e&&(t.headers.Authorization=e),r(t))}function rt(e,t){return[/^\/wp\/v2\/posts\/-?\d+/,/^\/wp\/v2\/pages\/-?\d+/].some(i=>i.test(e.path))?Promise.resolve([]):t(e)}function nt(e,t){return e.path&&e.path.startsWith("/wp/v2/media")&&e.method==="POST"&&e.body instanceof FormData&&e.body.get("post")==="-1"&&e.body.delete("post"),t(e)}window.GBKit=R();window.wp=window.wp||{};window.wp.apiFetch=m;We();it();async function it(){try{const{themeStyles:e,siteURL:t}=R(),{styles:r,scripts:n}=await m({url:`${t}/wp-json/__experimental/wp-block-editor/v1/editor-assets`});await st([...r,...n].join(""));const{dispatch:i}=window.wp.data,{store:s}=window.wp.editor,{store:a}=window.wp.preferences;m({path:"/wp-block-editor/v1/settings"}).then(h=>{i(s).updateEditorSettings(h)}).catch(()=>{const h={defaultEditorStyles:[{css:fe}]};i(s).updateEditorSettings(h)}),i(a).setDefaults("core/edit-post",{themeStyles:e});const d={post:Ze()},{default:l}=await we(async()=>{const{default:h}=await import("./index-DB9nabmU.js");return{default:h}},__vite__mapDeps([0,1]),import.meta.url),{createRoot:w,createElement:o,StrictMode:y}=window.wp.element;w(document.getElementById("root")).render(o(y,null,o(l,d)))}catch{window.location.href="index.html?error=remote_editor_load_error"}}async function st(e){const t=new window.DOMParser().parseFromString(e,"text/html"),r=Array.from(t.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!ot.test(n.src));for(const n of r)await ct(n)}const at=["api-fetch"],ot=new RegExp(at.flatMap(e=>[`wp-content/plugins/gutenberg/build/${e.replace(/\//g,"\\/")}\\b`,`wp-includes/js/dist/${e.replace(/\//g,"\\/")}\\b`]).join("|"));function ct(e){return new Promise(t=>{const r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>{t(!1)},document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()})}export{dt as a,pt as b,ut as e,ft as o};
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BIS0DtaD.js","./index-FgXrlpSx.css"])))=>i.map(i=>d[i]);
import fe from"@wordpress/block-editor/build-style/default-editor-styles.css?inline";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();const pe="modulepreload",he=function(e,t){return new URL(e,t).href},N={},we=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=Promise.allSettled(r.map(l=>{if(l=he(l,n),l in N)return;N[l]=!0;const w=l.endsWith(".css"),o=w?'[rel="stylesheet"]':"";if(!!n)for(let _=a.length-1;_>=0;_--){const f=a[_];if(f.href===l&&(!w||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${o}`))return;const h=document.createElement("link");if(h.rel=w?"stylesheet":pe,w||(h.as="script"),h.crossOrigin="",h.href=l,d&&h.setAttribute("nonce",d),document.head.appendChild(h),w)return new Promise((_,f)=>{h.addEventListener("load",_),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var C={},z;function ge(){return z||(z=1,function(e){(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(c){return i(a(c),arguments)}function n(c,d){return r.apply(null,[c].concat(d||[]))}function i(c,d){var l=1,w=c.length,o,y="",h,_,f,A,S,P,O,u;for(h=0;h<w;h++)if(typeof c[h]=="string")y+=c[h];else if(typeof c[h]=="object"){if(f=c[h],f.keys)for(o=d[l],_=0;_<f.keys.length;_++){if(o==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[_],f.keys[_-1]));o=o[f.keys[_]]}else f.param_no?o=d[f.param_no]:o=d[l++];if(t.not_type.test(f.type)&&t.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(r("[sprintf] expecting number but found %T",o));switch(t.number.test(f.type)&&(O=o>=0),f.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,f.width?parseInt(f.width):0);break;case"e":o=f.precision?parseFloat(o).toExponential(f.precision):parseFloat(o).toExponential();break;case"f":o=f.precision?parseFloat(o).toFixed(f.precision):parseFloat(o);break;case"g":o=f.precision?String(Number(o.toPrecision(f.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=f.precision?o.substring(0,f.precision):o;break;case"t":o=String(!!o),o=f.precision?o.substring(0,f.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=f.precision?o.substring(0,f.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=f.precision?o.substring(0,f.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(f.type)?y+=o:(t.number.test(f.type)&&(!O||f.sign)?(u=O?"+":"-",o=o.toString().replace(t.sign,"")):u="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",P=f.width-(u+o).length,A=f.width&&P>0?S.repeat(P):"",y+=f.align?u+o+A:S==="0"?u+A+o:A+u+o)}return y}var s=Object.create(null);function a(c){if(s[c])return s[c];for(var d=c,l,w=[],o=0;d;){if((l=t.text.exec(d))!==null)w.push(l[0]);else if((l=t.modulo.exec(d))!==null)w.push("%");else if((l=t.placeholder.exec(d))!==null){if(l[2]){o|=1;var y=[],h=l[2],_=[];if((_=t.key.exec(h))!==null)for(y.push(_[1]);(h=h.substring(_[0].length))!=="";)if((_=t.key_access.exec(h))!==null)y.push(_[1]);else if((_=t.index_access.exec(h))!==null)y.push(_[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=y}else o|=2;if(o===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");w.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return s[c]=w}e.sprintf=r,e.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()}(C)),C}ge();var H,re,T,ne;H={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};re=["(","?"];T={")":["("],":":["?","?:"]};ne=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function ye(e){for(var t=[],r=[],n,i,s,a;n=e.match(ne);){for(i=n[0],s=e.substr(0,n.index).trim(),s&&t.push(s);a=r.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(re.indexOf(a)>=0||H[a]<H[i]){r.push(a);break}t.push(a)}T[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var me={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function _e(e,t){var r=[],n,i,s,a,c,d;for(n=0;n<e.length;n++){if(c=e[n],a=me[c],a){for(i=a.length,s=Array(i);i--;)s[i]=r.pop();try{d=a.apply(null,s)}catch(l){return l}}else t.hasOwnProperty(c)?d=t[c]:d=+c;r.push(d)}return r[0]}function be(e){var t=ye(e);return function(r){return _e(t,r)}}function ve(e){var t=be(e);return function(r){return+t({n:r})}}var q={contextDelimiter:"",onMissingKey:null};function Ee(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function j(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in q)this.options[r]=t!==void 0&&r in t?t[r]:q[r]}j.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,s;return r||(n=this.data[e][""],s=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof s!="function"&&(i=Ee(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),s=ve(i)),r=this.pluralForms[e]=s),r(t)};j.prototype.dcnpgettext=function(e,t,r,n,i){var s,a,c;return i===void 0?s=0:s=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),c=this.data[e][a],c&&c[s]?c[s]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),s===0?r:n)};const K={"":{plural_forms(e){return e===1?0:1}}},xe=/^i18n\.(n?gettext|has_translation)(_|$)/,Ae=(e,t,r)=>{const n=new j({}),i=new Set,s=()=>{i.forEach(u=>u())},a=u=>(i.add(u),()=>i.delete(u)),c=(u="default")=>n.data[u],d=(u,p="default")=>{n.data[p]={...n.data[p],...u},n.data[p][""]={...K[""],...n.data[p]?.[""]},delete n.pluralForms[p]},l=(u,p)=>{d(u,p),s()},w=(u,p="default")=>{n.data[p]={...n.data[p],...u,"":{...K[""],...n.data[p]?.[""],...u?.[""]}},delete n.pluralForms[p],s()},o=(u,p)=>{n.data={},n.pluralForms={},l(u,p)},y=(u="default",p,g,v,E)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,g,v,E)),h=(u="default")=>u,_=(u,p)=>{let g=y(p,void 0,u);return r?(g=r.applyFilters("i18n.gettext",g,u,p),r.applyFilters("i18n.gettext_"+h(p),g,u,p)):g},f=(u,p,g)=>{let v=y(g,p,u);return r?(v=r.applyFilters("i18n.gettext_with_context",v,u,p,g),r.applyFilters("i18n.gettext_with_context_"+h(g),v,u,p,g)):v},A=(u,p,g,v)=>{let E=y(v,void 0,u,p,g);return r?(E=r.applyFilters("i18n.ngettext",E,u,p,g,v),r.applyFilters("i18n.ngettext_"+h(v),E,u,p,g,v)):E},S=(u,p,g,v,E)=>{let k=y(E,v,u,p,g);return r?(k=r.applyFilters("i18n.ngettext_with_context",k,u,p,g,v,E),r.applyFilters("i18n.ngettext_with_context_"+h(E),k,u,p,g,v,E)):k},P=()=>f("ltr","text direction")==="rtl",O=(u,p,g)=>{const v=p?p+""+u:u;let E=!!n.data?.[g??"default"]?.[v];return r&&(E=r.applyFilters("i18n.has_translation",E,u,p,g),E=r.applyFilters("i18n.has_translation_"+h(g),E,u,p,g)),E};if(r){const u=p=>{xe.test(p)&&s()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:c,setLocaleData:l,addLocaleData:w,resetLocaleData:o,subscribe:a,__:_,_x:f,_n:A,_nx:S,isRTL:P,hasTranslation:O}};function ie(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function U(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function B(e,t){return function(n,i,s,a=10){const c=e[t];if(!U(n)||!ie(i))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:s,priority:a,namespace:i};if(c[n]){const l=c[n].handlers;let w;for(w=l.length;w>0&&!(a>=l[w-1].priority);w--);w===l.length?l[w]=d:l.splice(w,0,d),c.__current.forEach(o=>{o.name===n&&o.currentIndex>=w&&o.currentIndex++})}else c[n]={handlers:[d],runs:0};n!=="hookAdded"&&e.doAction("hookAdded",n,i,s,a)}}function D(e,t,r=!1){return function(i,s){const a=e[t];if(!U(i)||!r&&!ie(s))return;if(!a[i])return 0;let c=0;if(r)c=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===s&&(d.splice(l,1),c++,a.__current.forEach(w=>{w.name===i&&w.currentIndex>=l&&w.currentIndex--}))}return i!=="hookRemoved"&&e.doAction("hookRemoved",i,s),c}}function G(e,t){return function(n,i){const s=e[t];return typeof i<"u"?n in s&&s[n].handlers.some(a=>a.namespace===i):n in s}}function M(e,t,r,n){return function(s,...a){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const d=c[s].handlers;if(!d||!d.length)return r?a[0]:void 0;const l={name:s,currentIndex:0};async function w(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=await d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}function o(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}return(n?w:o)()}}function Q(e,t){return function(){var n;const i=e[t];return(n=Array.from(i.__current).at(-1)?.name)!==null&&n!==void 0?n:null}}function J(e,t){return function(n){const i=e[t];return typeof n>"u"?i.__current.size>0:Array.from(i.__current).some(s=>s.name===n)}}function X(e,t){return function(n){const i=e[t];if(U(n))return i[n]&&i[n].runs?i[n].runs:0}}class Se{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=B(this,"actions"),this.addFilter=B(this,"filters"),this.removeAction=D(this,"actions"),this.removeFilter=D(this,"filters"),this.hasAction=G(this,"actions"),this.hasFilter=G(this,"filters"),this.removeAllActions=D(this,"actions",!0),this.removeAllFilters=D(this,"filters",!0),this.doAction=M(this,"actions",!1,!1),this.doActionAsync=M(this,"actions",!1,!0),this.applyFilters=M(this,"filters",!0,!1),this.applyFiltersAsync=M(this,"filters",!0,!0),this.currentAction=Q(this,"actions"),this.currentFilter=Q(this,"filters"),this.doingAction=J(this,"actions"),this.doingFilter=J(this,"filters"),this.didAction=X(this,"actions"),this.didFilter=X(this,"filters")}}function Pe(){return new Se}const Oe=Pe(),b=Ae(void 0,void 0,Oe);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);const L=b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);function Te(e){const t=(r,n)=>{const{headers:i={}}=r;for(const s in i)if(s.toLowerCase()==="x-wp-nonce"&&i[s]===t.nonce)return n(r);return n({...r,headers:{...i,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const se=(e,t)=>{let r=e.path,n,i;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(n=e.namespace.replace(/^\/|\/$/g,""),i=e.endpoint.replace(/^\//,""),i?r=n+"/"+i:r=n),delete e.namespace,delete e.endpoint,t({...e,path:r})},Re=e=>(t,r)=>se(t,n=>{let i=n.url,s=n.path,a;return typeof s=="string"&&(a=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof a=="string"&&a.indexOf("?")!==-1&&(s=s.replace("?","&")),i=a+s),r({...n,url:i})});function ke(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ae(e){let t="";const r=Object.entries(e);let n;for(;n=r.shift();){let[i,s]=n;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[d,l]of c)r.unshift([`${i}[${d}]`,l])}else s!==void 0&&(s===null&&(s=""),t+="&"+[i,s].map(encodeURIComponent).join("="))}return t.substr(1)}function De(e){try{return decodeURIComponent(e)}catch{return e}}function Me(e,t,r){const n=t.length,i=n-1;for(let s=0;s<n;s++){let a=t[s];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;const c=!isNaN(Number(t[s+1]));e[a]=s===i?r:e[a]||(c?[]:{}),Array.isArray(e[a])&&!c&&(e[a]={...e[a]}),e=e[a]}}function F(e){return(ke(e)||"").replace(/\+/g,"%20").split("&").reduce((t,r)=>{const[n,i=""]=r.split("=").filter(Boolean).map(De);if(n){const s=n.replace(/\]/g,"").split("[");Me(t,s,i)}return t},Object.create(null))}function x(e="",t){if(!t||!Object.keys(t).length)return e;let r=e;const n=e.indexOf("?");return n!==-1&&(t=Object.assign(F(e),t),r=r.substr(0,n)),r+"?"+ae(t)}function I(e,t){return F(e)[t]}function V(e,t){return I(e,t)!==void 0}function Z(e,...t){const r=e.indexOf("?");if(r===-1)return e;const n=F(e),i=e.substr(0,r);t.forEach(a=>delete n[a]);const s=ae(n);return s?i+"?"+s:i}function W(e){const t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map(i=>i.split("=")).map(i=>i.map(decodeURIComponent)).sort((i,s)=>i[0].localeCompare(s[0])).map(i=>i.map(encodeURIComponent)).map(i=>i.join("=")).join("&"):n}function Le(e){const t=Object.fromEntries(Object.entries(e).map(([r,n])=>[W(r),n]));return(r,n)=>{const{parse:i=!0}=r;let s=r.path;if(!s&&r.url){const{rest_route:d,...l}=F(r.url);typeof d=="string"&&(s=x(d,l))}if(typeof s!="string")return n(r);const a=r.method||"GET",c=W(s);if(a==="GET"&&t[c]){const d=t[c];return delete t[c],Y(d,!!i)}else if(a==="OPTIONS"&&t[a]&&t[a][c]){const d=t[a][c];return delete t[a][c],Y(d,!!i)}return n(r)}}function Y(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const Fe=({path:e,url:t,...r},n)=>({...r,url:t&&x(t,n),path:e&&x(e,n)}),ee=e=>e.json?e.json():Promise.reject(e),Ce=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},te=e=>{const{next:t}=Ce(e.headers.get("link"));return t},He=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,r=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||r},oe=async(e,t)=>{if(e.parse===!1||!He(e))return t(e);const r=await m({...Fe(e,{per_page:100}),parse:!1}),n=await ee(r);if(!Array.isArray(n))return n;let i=te(r);if(!i)return n;let s=[].concat(n);for(;i;){const a=await m({...e,path:void 0,url:i,parse:!1}),c=await ee(a);s=s.concat(c),i=te(a)}return s},Ie=new Set(["PATCH","PUT","DELETE"]),je="GET",Ue=(e,t)=>{const{method:r=je}=e;return Ie.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},$e=(e,t)=>(typeof e.url=="string"&&!V(e.url,"_locale")&&(e.url=x(e.url,{_locale:"user"})),typeof e.path=="string"&&!V(e.path,"_locale")&&(e.path=x(e.path,{_locale:"user"})),t(e)),Ne=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,ze=e=>{const t={code:"invalid_json",message:L("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},ce=(e,t=!0)=>Promise.resolve(Ne(e,t)).catch(r=>$(r,t));function $(e,t=!0){if(!t)throw e;return ze(e).then(r=>{const n={code:"unknown_error",message:L("An unknown error occurred.")};throw r||n})}function qe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const Ke=(e,t)=>{if(!qe(e))return t(e);let r=0;const n=5,i=s=>(r++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>r<n?i(s):(t({path:`/wp/v2/media/${s}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(s=>{if(!s.headers)return Promise.reject(s);const a=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&a?i(a).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:L("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):$(s,e.parse)}).then(s=>ce(s,e.parse))},Be=e=>(t,r)=>{if(typeof t.url=="string"){const n=I(t.url,"wp_theme_preview");n===void 0?t.url=x(t.url,{wp_theme_preview:e}):n===""&&(t.url=Z(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const n=I(t.path,"wp_theme_preview");n===void 0?t.path=x(t.path,{wp_theme_preview:e}):n===""&&(t.path=Z(t.path,"wp_theme_preview"))}return r(t)},Ge={Accept:"application/json, */*;q=0.1"},Qe={credentials:"include"},le=[$e,se,Ue,oe];function Je(e){le.unshift(e)}const ue=e=>{if(e.status>=200&&e.status<300)return e;throw e},Xe=e=>{const{url:t,path:r,data:n,parse:i=!0,...s}=e;let{body:a,headers:c}=e;return c={...Ge,...c},n&&(a=JSON.stringify(n),c["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,{...Qe,...s,body:a,headers:c}).then(l=>Promise.resolve(l).then(ue).catch(w=>$(w,i)).then(w=>ce(w,i)),l=>{throw l&&l.name==="AbortError"?l:{code:"fetch_error",message:L("You are probably offline.")}})};let de=Xe;function Ve(e){de=e}function m(e){return le.reduceRight((r,n)=>i=>n(i,r),de)(e).catch(r=>r.code!=="rest_cookie_invalid_nonce"?Promise.reject(r):window.fetch(m.nonceEndpoint).then(ue).then(n=>n.text()).then(n=>(m.nonceMiddleware.nonce=n,m(e))))}m.use=Je;m.setFetchHandler=Ve;m.createNonceMiddleware=Te;m.createPreloadingMiddleware=Le;m.createRootURLMiddleware=Re;m.fetchAllMiddleware=oe;m.mediaUploadMiddleware=Ke;m.createThemePreviewMiddleware=Be;function ut(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function dt(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function ft(e,t){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(e,t),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:e,hasRedo:t}})}function pt(e){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(e)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:e})}function R(){if(window.GBKit)return window.GBKit;if(window.editorDelegate)try{return JSON.parse(window.editorDelegate.getEditorConfiguration())}catch{return{}}try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function Ze(){const{post:e}=R();return e?{id:e.id,title:{raw:decodeURIComponent(e.title)},content:{raw:decodeURIComponent(e.content)},type:e.type||"post"}:{type:"post",status:"draft",id:-1}}function We(){const{siteApiRoot:e="",authHeader:t}=R();m.use(m.createRootURLMiddleware(e)),m.use(Ye),m.use(et),m.use(tt(t)),m.use(rt),m.use(nt),m.use(m.createPreloadingMiddleware({"/wp/v2/types?context=view":{body:{post:{description:"",hierarchical:!1,has_archive:!1,name:"Posts",slug:"post",taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}},page:{description:"",hierarchical:!0,has_archive:!1,name:"Pages",slug:"page",taxonomies:[],rest_base:"pages",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}}}},"/wp/v2/types/post?context=edit":{body:{name:"Posts",slug:"post",supports:{title:!0,editor:!0,author:!0,thumbnail:!0,excerpt:!0,trackbacks:!0,"custom-fields":!0,comments:!0,revisions:!0,"post-formats":!0,autosave:!0},taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1}}}))}function Ye(e,t){return e.mode="cors",delete e.headers["x-wp-api-fetch-from-editor"],t(e)}function et(e,t){const{siteApiNamespace:r}=R();return e.path&&r&&!e.path.includes(r)&&(e.path=e.path.replace(/^(?<apiPath>\/?(?:[\w.-]+\/){2})/,`$<apiPath>${r}/`)),t(e)}function tt(e){return(t,r)=>(t.headers=t.headers||{},e&&(t.headers.Authorization=e),r(t))}function rt(e,t){return[/^\/wp\/v2\/posts\/-?\d+/,/^\/wp\/v2\/pages\/-?\d+/].some(i=>i.test(e.path))?Promise.resolve([]):t(e)}function nt(e,t){return e.path&&e.path.startsWith("/wp/v2/media")&&e.method==="POST"&&e.body instanceof FormData&&e.body.get("post")==="-1"&&e.body.delete("post"),t(e)}window.GBKit=R();window.wp=window.wp||{};window.wp.apiFetch=m;We();it();async function it(){try{const{themeStyles:e,siteURL:t}=R(),{styles:r,scripts:n}=await m({url:`${t}/wp-json/__experimental/wp-block-editor/v1/editor-assets`});await st([...r,...n].join(""));const{dispatch:i}=window.wp.data,{store:s}=window.wp.editor,{store:a}=window.wp.preferences;m({path:"/wp-block-editor/v1/settings"}).then(h=>{i(s).updateEditorSettings(h)}).catch(()=>{const h={defaultEditorStyles:[{css:fe}]};i(s).updateEditorSettings(h)}),i(a).setDefaults("core/edit-post",{themeStyles:e});const d={post:Ze()},{default:l}=await we(async()=>{const{default:h}=await import("./index-BIS0DtaD.js");return{default:h}},__vite__mapDeps([0,1]),import.meta.url),{createRoot:w,createElement:o,StrictMode:y}=window.wp.element;w(document.getElementById("root")).render(o(y,null,o(l,d)))}catch{window.location.href="index.html?error=remote_editor_load_error"}}async function st(e){const t=new window.DOMParser().parseFromString(e,"text/html"),r=Array.from(t.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!ot.test(n.src));for(const n of r)await ct(n)}const at=["api-fetch"],ot=new RegExp(at.flatMap(e=>[`wp-content/plugins/gutenberg/build/${e.replace(/\//g,"\\/")}\\b`,`wp-includes/js/dist/${e.replace(/\//g,"\\/")}\\b`]).join("|"));function ct(e){return new Promise(t=>{const r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>{t(!1)},document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()})}export{dt as a,pt as b,ut as e,ft as o};

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Copilot Autofix AI about 13 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DB9nabmU.js","./index-CkUrYNsQ.css"])))=>i.map(i=>d[i]);
import fe from"@wordpress/block-editor/build-style/default-editor-styles.css?inline";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();const pe="modulepreload",he=function(e,t){return new URL(e,t).href},N={},we=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=Promise.allSettled(r.map(l=>{if(l=he(l,n),l in N)return;N[l]=!0;const w=l.endsWith(".css"),o=w?'[rel="stylesheet"]':"";if(!!n)for(let _=a.length-1;_>=0;_--){const f=a[_];if(f.href===l&&(!w||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${o}`))return;const h=document.createElement("link");if(h.rel=w?"stylesheet":pe,w||(h.as="script"),h.crossOrigin="",h.href=l,d&&h.setAttribute("nonce",d),document.head.appendChild(h),w)return new Promise((_,f)=>{h.addEventListener("load",_),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var C={},z;function ge(){return z||(z=1,function(e){(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(c){return i(a(c),arguments)}function n(c,d){return r.apply(null,[c].concat(d||[]))}function i(c,d){var l=1,w=c.length,o,y="",h,_,f,A,S,P,O,u;for(h=0;h<w;h++)if(typeof c[h]=="string")y+=c[h];else if(typeof c[h]=="object"){if(f=c[h],f.keys)for(o=d[l],_=0;_<f.keys.length;_++){if(o==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[_],f.keys[_-1]));o=o[f.keys[_]]}else f.param_no?o=d[f.param_no]:o=d[l++];if(t.not_type.test(f.type)&&t.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(r("[sprintf] expecting number but found %T",o));switch(t.number.test(f.type)&&(O=o>=0),f.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,f.width?parseInt(f.width):0);break;case"e":o=f.precision?parseFloat(o).toExponential(f.precision):parseFloat(o).toExponential();break;case"f":o=f.precision?parseFloat(o).toFixed(f.precision):parseFloat(o);break;case"g":o=f.precision?String(Number(o.toPrecision(f.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=f.precision?o.substring(0,f.precision):o;break;case"t":o=String(!!o),o=f.precision?o.substring(0,f.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=f.precision?o.substring(0,f.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=f.precision?o.substring(0,f.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(f.type)?y+=o:(t.number.test(f.type)&&(!O||f.sign)?(u=O?"+":"-",o=o.toString().replace(t.sign,"")):u="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",P=f.width-(u+o).length,A=f.width&&P>0?S.repeat(P):"",y+=f.align?u+o+A:S==="0"?u+A+o:A+u+o)}return y}var s=Object.create(null);function a(c){if(s[c])return s[c];for(var d=c,l,w=[],o=0;d;){if((l=t.text.exec(d))!==null)w.push(l[0]);else if((l=t.modulo.exec(d))!==null)w.push("%");else if((l=t.placeholder.exec(d))!==null){if(l[2]){o|=1;var y=[],h=l[2],_=[];if((_=t.key.exec(h))!==null)for(y.push(_[1]);(h=h.substring(_[0].length))!=="";)if((_=t.key_access.exec(h))!==null)y.push(_[1]);else if((_=t.index_access.exec(h))!==null)y.push(_[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=y}else o|=2;if(o===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");w.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return s[c]=w}e.sprintf=r,e.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()}(C)),C}ge();var H,re,T,ne;H={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};re=["(","?"];T={")":["("],":":["?","?:"]};ne=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function ye(e){for(var t=[],r=[],n,i,s,a;n=e.match(ne);){for(i=n[0],s=e.substr(0,n.index).trim(),s&&t.push(s);a=r.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(re.indexOf(a)>=0||H[a]<H[i]){r.push(a);break}t.push(a)}T[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var me={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function _e(e,t){var r=[],n,i,s,a,c,d;for(n=0;n<e.length;n++){if(c=e[n],a=me[c],a){for(i=a.length,s=Array(i);i--;)s[i]=r.pop();try{d=a.apply(null,s)}catch(l){return l}}else t.hasOwnProperty(c)?d=t[c]:d=+c;r.push(d)}return r[0]}function be(e){var t=ye(e);return function(r){return _e(t,r)}}function ve(e){var t=be(e);return function(r){return+t({n:r})}}var q={contextDelimiter:"",onMissingKey:null};function Ee(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function j(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in q)this.options[r]=t!==void 0&&r in t?t[r]:q[r]}j.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,s;return r||(n=this.data[e][""],s=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof s!="function"&&(i=Ee(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),s=ve(i)),r=this.pluralForms[e]=s),r(t)};j.prototype.dcnpgettext=function(e,t,r,n,i){var s,a,c;return i===void 0?s=0:s=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),c=this.data[e][a],c&&c[s]?c[s]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),s===0?r:n)};const K={"":{plural_forms(e){return e===1?0:1}}},xe=/^i18n\.(n?gettext|has_translation)(_|$)/,Ae=(e,t,r)=>{const n=new j({}),i=new Set,s=()=>{i.forEach(u=>u())},a=u=>(i.add(u),()=>i.delete(u)),c=(u="default")=>n.data[u],d=(u,p="default")=>{n.data[p]={...n.data[p],...u},n.data[p][""]={...K[""],...n.data[p]?.[""]},delete n.pluralForms[p]},l=(u,p)=>{d(u,p),s()},w=(u,p="default")=>{n.data[p]={...n.data[p],...u,"":{...K[""],...n.data[p]?.[""],...u?.[""]}},delete n.pluralForms[p],s()},o=(u,p)=>{n.data={},n.pluralForms={},l(u,p)},y=(u="default",p,g,v,E)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,g,v,E)),h=(u="default")=>u,_=(u,p)=>{let g=y(p,void 0,u);return r?(g=r.applyFilters("i18n.gettext",g,u,p),r.applyFilters("i18n.gettext_"+h(p),g,u,p)):g},f=(u,p,g)=>{let v=y(g,p,u);return r?(v=r.applyFilters("i18n.gettext_with_context",v,u,p,g),r.applyFilters("i18n.gettext_with_context_"+h(g),v,u,p,g)):v},A=(u,p,g,v)=>{let E=y(v,void 0,u,p,g);return r?(E=r.applyFilters("i18n.ngettext",E,u,p,g,v),r.applyFilters("i18n.ngettext_"+h(v),E,u,p,g,v)):E},S=(u,p,g,v,E)=>{let k=y(E,v,u,p,g);return r?(k=r.applyFilters("i18n.ngettext_with_context",k,u,p,g,v,E),r.applyFilters("i18n.ngettext_with_context_"+h(E),k,u,p,g,v,E)):k},P=()=>f("ltr","text direction")==="rtl",O=(u,p,g)=>{const v=p?p+""+u:u;let E=!!n.data?.[g??"default"]?.[v];return r&&(E=r.applyFilters("i18n.has_translation",E,u,p,g),E=r.applyFilters("i18n.has_translation_"+h(g),E,u,p,g)),E};if(r){const u=p=>{xe.test(p)&&s()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:c,setLocaleData:l,addLocaleData:w,resetLocaleData:o,subscribe:a,__:_,_x:f,_n:A,_nx:S,isRTL:P,hasTranslation:O}};function ie(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function U(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function B(e,t){return function(n,i,s,a=10){const c=e[t];if(!U(n)||!ie(i))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:s,priority:a,namespace:i};if(c[n]){const l=c[n].handlers;let w;for(w=l.length;w>0&&!(a>=l[w-1].priority);w--);w===l.length?l[w]=d:l.splice(w,0,d),c.__current.forEach(o=>{o.name===n&&o.currentIndex>=w&&o.currentIndex++})}else c[n]={handlers:[d],runs:0};n!=="hookAdded"&&e.doAction("hookAdded",n,i,s,a)}}function D(e,t,r=!1){return function(i,s){const a=e[t];if(!U(i)||!r&&!ie(s))return;if(!a[i])return 0;let c=0;if(r)c=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===s&&(d.splice(l,1),c++,a.__current.forEach(w=>{w.name===i&&w.currentIndex>=l&&w.currentIndex--}))}return i!=="hookRemoved"&&e.doAction("hookRemoved",i,s),c}}function G(e,t){return function(n,i){const s=e[t];return typeof i<"u"?n in s&&s[n].handlers.some(a=>a.namespace===i):n in s}}function M(e,t,r,n){return function(s,...a){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const d=c[s].handlers;if(!d||!d.length)return r?a[0]:void 0;const l={name:s,currentIndex:0};async function w(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=await d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}function o(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}return(n?w:o)()}}function Q(e,t){return function(){var n;const i=e[t];return(n=Array.from(i.__current).at(-1)?.name)!==null&&n!==void 0?n:null}}function J(e,t){return function(n){const i=e[t];return typeof n>"u"?i.__current.size>0:Array.from(i.__current).some(s=>s.name===n)}}function X(e,t){return function(n){const i=e[t];if(U(n))return i[n]&&i[n].runs?i[n].runs:0}}class Se{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=B(this,"actions"),this.addFilter=B(this,"filters"),this.removeAction=D(this,"actions"),this.removeFilter=D(this,"filters"),this.hasAction=G(this,"actions"),this.hasFilter=G(this,"filters"),this.removeAllActions=D(this,"actions",!0),this.removeAllFilters=D(this,"filters",!0),this.doAction=M(this,"actions",!1,!1),this.doActionAsync=M(this,"actions",!1,!0),this.applyFilters=M(this,"filters",!0,!1),this.applyFiltersAsync=M(this,"filters",!0,!0),this.currentAction=Q(this,"actions"),this.currentFilter=Q(this,"filters"),this.doingAction=J(this,"actions"),this.doingFilter=J(this,"filters"),this.didAction=X(this,"actions"),this.didFilter=X(this,"filters")}}function Pe(){return new Se}const Oe=Pe(),b=Ae(void 0,void 0,Oe);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);const L=b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);function Te(e){const t=(r,n)=>{const{headers:i={}}=r;for(const s in i)if(s.toLowerCase()==="x-wp-nonce"&&i[s]===t.nonce)return n(r);return n({...r,headers:{...i,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const se=(e,t)=>{let r=e.path,n,i;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(n=e.namespace.replace(/^\/|\/$/g,""),i=e.endpoint.replace(/^\//,""),i?r=n+"/"+i:r=n),delete e.namespace,delete e.endpoint,t({...e,path:r})},Re=e=>(t,r)=>se(t,n=>{let i=n.url,s=n.path,a;return typeof s=="string"&&(a=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof a=="string"&&a.indexOf("?")!==-1&&(s=s.replace("?","&")),i=a+s),r({...n,url:i})});function ke(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ae(e){let t="";const r=Object.entries(e);let n;for(;n=r.shift();){let[i,s]=n;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[d,l]of c)r.unshift([`${i}[${d}]`,l])}else s!==void 0&&(s===null&&(s=""),t+="&"+[i,s].map(encodeURIComponent).join("="))}return t.substr(1)}function De(e){try{return decodeURIComponent(e)}catch{return e}}function Me(e,t,r){const n=t.length,i=n-1;for(let s=0;s<n;s++){let a=t[s];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;const c=!isNaN(Number(t[s+1]));e[a]=s===i?r:e[a]||(c?[]:{}),Array.isArray(e[a])&&!c&&(e[a]={...e[a]}),e=e[a]}}function F(e){return(ke(e)||"").replace(/\+/g,"%20").split("&").reduce((t,r)=>{const[n,i=""]=r.split("=").filter(Boolean).map(De);if(n){const s=n.replace(/\]/g,"").split("[");Me(t,s,i)}return t},Object.create(null))}function x(e="",t){if(!t||!Object.keys(t).length)return e;let r=e;const n=e.indexOf("?");return n!==-1&&(t=Object.assign(F(e),t),r=r.substr(0,n)),r+"?"+ae(t)}function I(e,t){return F(e)[t]}function V(e,t){return I(e,t)!==void 0}function Z(e,...t){const r=e.indexOf("?");if(r===-1)return e;const n=F(e),i=e.substr(0,r);t.forEach(a=>delete n[a]);const s=ae(n);return s?i+"?"+s:i}function W(e){const t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map(i=>i.split("=")).map(i=>i.map(decodeURIComponent)).sort((i,s)=>i[0].localeCompare(s[0])).map(i=>i.map(encodeURIComponent)).map(i=>i.join("=")).join("&"):n}function Le(e){const t=Object.fromEntries(Object.entries(e).map(([r,n])=>[W(r),n]));return(r,n)=>{const{parse:i=!0}=r;let s=r.path;if(!s&&r.url){const{rest_route:d,...l}=F(r.url);typeof d=="string"&&(s=x(d,l))}if(typeof s!="string")return n(r);const a=r.method||"GET",c=W(s);if(a==="GET"&&t[c]){const d=t[c];return delete t[c],Y(d,!!i)}else if(a==="OPTIONS"&&t[a]&&t[a][c]){const d=t[a][c];return delete t[a][c],Y(d,!!i)}return n(r)}}function Y(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const Fe=({path:e,url:t,...r},n)=>({...r,url:t&&x(t,n),path:e&&x(e,n)}),ee=e=>e.json?e.json():Promise.reject(e),Ce=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},te=e=>{const{next:t}=Ce(e.headers.get("link"));return t},He=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,r=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||r},oe=async(e,t)=>{if(e.parse===!1||!He(e))return t(e);const r=await m({...Fe(e,{per_page:100}),parse:!1}),n=await ee(r);if(!Array.isArray(n))return n;let i=te(r);if(!i)return n;let s=[].concat(n);for(;i;){const a=await m({...e,path:void 0,url:i,parse:!1}),c=await ee(a);s=s.concat(c),i=te(a)}return s},Ie=new Set(["PATCH","PUT","DELETE"]),je="GET",Ue=(e,t)=>{const{method:r=je}=e;return Ie.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},$e=(e,t)=>(typeof e.url=="string"&&!V(e.url,"_locale")&&(e.url=x(e.url,{_locale:"user"})),typeof e.path=="string"&&!V(e.path,"_locale")&&(e.path=x(e.path,{_locale:"user"})),t(e)),Ne=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,ze=e=>{const t={code:"invalid_json",message:L("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},ce=(e,t=!0)=>Promise.resolve(Ne(e,t)).catch(r=>$(r,t));function $(e,t=!0){if(!t)throw e;return ze(e).then(r=>{const n={code:"unknown_error",message:L("An unknown error occurred.")};throw r||n})}function qe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const Ke=(e,t)=>{if(!qe(e))return t(e);let r=0;const n=5,i=s=>(r++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>r<n?i(s):(t({path:`/wp/v2/media/${s}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(s=>{if(!s.headers)return Promise.reject(s);const a=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&a?i(a).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:L("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):$(s,e.parse)}).then(s=>ce(s,e.parse))},Be=e=>(t,r)=>{if(typeof t.url=="string"){const n=I(t.url,"wp_theme_preview");n===void 0?t.url=x(t.url,{wp_theme_preview:e}):n===""&&(t.url=Z(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const n=I(t.path,"wp_theme_preview");n===void 0?t.path=x(t.path,{wp_theme_preview:e}):n===""&&(t.path=Z(t.path,"wp_theme_preview"))}return r(t)},Ge={Accept:"application/json, */*;q=0.1"},Qe={credentials:"include"},le=[$e,se,Ue,oe];function Je(e){le.unshift(e)}const ue=e=>{if(e.status>=200&&e.status<300)return e;throw e},Xe=e=>{const{url:t,path:r,data:n,parse:i=!0,...s}=e;let{body:a,headers:c}=e;return c={...Ge,...c},n&&(a=JSON.stringify(n),c["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,{...Qe,...s,body:a,headers:c}).then(l=>Promise.resolve(l).then(ue).catch(w=>$(w,i)).then(w=>ce(w,i)),l=>{throw l&&l.name==="AbortError"?l:{code:"fetch_error",message:L("You are probably offline.")}})};let de=Xe;function Ve(e){de=e}function m(e){return le.reduceRight((r,n)=>i=>n(i,r),de)(e).catch(r=>r.code!=="rest_cookie_invalid_nonce"?Promise.reject(r):window.fetch(m.nonceEndpoint).then(ue).then(n=>n.text()).then(n=>(m.nonceMiddleware.nonce=n,m(e))))}m.use=Je;m.setFetchHandler=Ve;m.createNonceMiddleware=Te;m.createPreloadingMiddleware=Le;m.createRootURLMiddleware=Re;m.fetchAllMiddleware=oe;m.mediaUploadMiddleware=Ke;m.createThemePreviewMiddleware=Be;function ut(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function dt(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function ft(e,t){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(e,t),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:e,hasRedo:t}})}function pt(e){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(e)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:e})}function R(){if(window.GBKit)return window.GBKit;if(window.editorDelegate)try{return JSON.parse(window.editorDelegate.getEditorConfiguration())}catch{return{}}try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function Ze(){const{post:e}=R();return e?{id:e.id,title:{raw:decodeURIComponent(e.title)},content:{raw:decodeURIComponent(e.content)},type:e.type||"post"}:{type:"post",status:"draft",id:-1}}function We(){const{siteApiRoot:e="",authHeader:t}=R();m.use(m.createRootURLMiddleware(e)),m.use(Ye),m.use(et),m.use(tt(t)),m.use(rt),m.use(nt),m.use(m.createPreloadingMiddleware({"/wp/v2/types?context=view":{body:{post:{description:"",hierarchical:!1,has_archive:!1,name:"Posts",slug:"post",taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}},page:{description:"",hierarchical:!0,has_archive:!1,name:"Pages",slug:"page",taxonomies:[],rest_base:"pages",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}}}},"/wp/v2/types/post?context=edit":{body:{name:"Posts",slug:"post",supports:{title:!0,editor:!0,author:!0,thumbnail:!0,excerpt:!0,trackbacks:!0,"custom-fields":!0,comments:!0,revisions:!0,"post-formats":!0,autosave:!0},taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1}}}))}function Ye(e,t){return e.mode="cors",delete e.headers["x-wp-api-fetch-from-editor"],t(e)}function et(e,t){const{siteApiNamespace:r}=R();return e.path&&r&&!e.path.includes(r)&&(e.path=e.path.replace(/^(?<apiPath>\/?(?:[\w.-]+\/){2})/,`$<apiPath>${r}/`)),t(e)}function tt(e){return(t,r)=>(t.headers=t.headers||{},e&&(t.headers.Authorization=e),r(t))}function rt(e,t){return[/^\/wp\/v2\/posts\/-?\d+/,/^\/wp\/v2\/pages\/-?\d+/].some(i=>i.test(e.path))?Promise.resolve([]):t(e)}function nt(e,t){return e.path&&e.path.startsWith("/wp/v2/media")&&e.method==="POST"&&e.body instanceof FormData&&e.body.get("post")==="-1"&&e.body.delete("post"),t(e)}window.GBKit=R();window.wp=window.wp||{};window.wp.apiFetch=m;We();it();async function it(){try{const{themeStyles:e,siteURL:t}=R(),{styles:r,scripts:n}=await m({url:`${t}/wp-json/__experimental/wp-block-editor/v1/editor-assets`});await st([...r,...n].join(""));const{dispatch:i}=window.wp.data,{store:s}=window.wp.editor,{store:a}=window.wp.preferences;m({path:"/wp-block-editor/v1/settings"}).then(h=>{i(s).updateEditorSettings(h)}).catch(()=>{const h={defaultEditorStyles:[{css:fe}]};i(s).updateEditorSettings(h)}),i(a).setDefaults("core/edit-post",{themeStyles:e});const d={post:Ze()},{default:l}=await we(async()=>{const{default:h}=await import("./index-DB9nabmU.js");return{default:h}},__vite__mapDeps([0,1]),import.meta.url),{createRoot:w,createElement:o,StrictMode:y}=window.wp.element;w(document.getElementById("root")).render(o(y,null,o(l,d)))}catch{window.location.href="index.html?error=remote_editor_load_error"}}async function st(e){const t=new window.DOMParser().parseFromString(e,"text/html"),r=Array.from(t.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!ot.test(n.src));for(const n of r)await ct(n)}const at=["api-fetch"],ot=new RegExp(at.flatMap(e=>[`wp-content/plugins/gutenberg/build/${e.replace(/\//g,"\\/")}\\b`,`wp-includes/js/dist/${e.replace(/\//g,"\\/")}\\b`]).join("|"));function ct(e){return new Promise(t=>{const r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>{t(!1)},document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()})}export{dt as a,pt as b,ut as e,ft as o};
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BIS0DtaD.js","./index-FgXrlpSx.css"])))=>i.map(i=>d[i]);
import fe from"@wordpress/block-editor/build-style/default-editor-styles.css?inline";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();const pe="modulepreload",he=function(e,t){return new URL(e,t).href},N={},we=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");i=Promise.allSettled(r.map(l=>{if(l=he(l,n),l in N)return;N[l]=!0;const w=l.endsWith(".css"),o=w?'[rel="stylesheet"]':"";if(!!n)for(let _=a.length-1;_>=0;_--){const f=a[_];if(f.href===l&&(!w||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${o}`))return;const h=document.createElement("link");if(h.rel=w?"stylesheet":pe,w||(h.as="script"),h.crossOrigin="",h.href=l,d&&h.setAttribute("nonce",d),document.head.appendChild(h),w)return new Promise((_,f)=>{h.addEventListener("load",_),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var C={},z;function ge(){return z||(z=1,function(e){(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(c){return i(a(c),arguments)}function n(c,d){return r.apply(null,[c].concat(d||[]))}function i(c,d){var l=1,w=c.length,o,y="",h,_,f,A,S,P,O,u;for(h=0;h<w;h++)if(typeof c[h]=="string")y+=c[h];else if(typeof c[h]=="object"){if(f=c[h],f.keys)for(o=d[l],_=0;_<f.keys.length;_++){if(o==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[_],f.keys[_-1]));o=o[f.keys[_]]}else f.param_no?o=d[f.param_no]:o=d[l++];if(t.not_type.test(f.type)&&t.not_primitive.test(f.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(f.type)&&typeof o!="number"&&isNaN(o))throw new TypeError(r("[sprintf] expecting number but found %T",o));switch(t.number.test(f.type)&&(O=o>=0),f.type){case"b":o=parseInt(o,10).toString(2);break;case"c":o=String.fromCharCode(parseInt(o,10));break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,f.width?parseInt(f.width):0);break;case"e":o=f.precision?parseFloat(o).toExponential(f.precision):parseFloat(o).toExponential();break;case"f":o=f.precision?parseFloat(o).toFixed(f.precision):parseFloat(o);break;case"g":o=f.precision?String(Number(o.toPrecision(f.precision))):parseFloat(o);break;case"o":o=(parseInt(o,10)>>>0).toString(8);break;case"s":o=String(o),o=f.precision?o.substring(0,f.precision):o;break;case"t":o=String(!!o),o=f.precision?o.substring(0,f.precision):o;break;case"T":o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=f.precision?o.substring(0,f.precision):o;break;case"u":o=parseInt(o,10)>>>0;break;case"v":o=o.valueOf(),o=f.precision?o.substring(0,f.precision):o;break;case"x":o=(parseInt(o,10)>>>0).toString(16);break;case"X":o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(f.type)?y+=o:(t.number.test(f.type)&&(!O||f.sign)?(u=O?"+":"-",o=o.toString().replace(t.sign,"")):u="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",P=f.width-(u+o).length,A=f.width&&P>0?S.repeat(P):"",y+=f.align?u+o+A:S==="0"?u+A+o:A+u+o)}return y}var s=Object.create(null);function a(c){if(s[c])return s[c];for(var d=c,l,w=[],o=0;d;){if((l=t.text.exec(d))!==null)w.push(l[0]);else if((l=t.modulo.exec(d))!==null)w.push("%");else if((l=t.placeholder.exec(d))!==null){if(l[2]){o|=1;var y=[],h=l[2],_=[];if((_=t.key.exec(h))!==null)for(y.push(_[1]);(h=h.substring(_[0].length))!=="";)if((_=t.key_access.exec(h))!==null)y.push(_[1]);else if((_=t.index_access.exec(h))!==null)y.push(_[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=y}else o|=2;if(o===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");w.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return s[c]=w}e.sprintf=r,e.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()}(C)),C}ge();var H,re,T,ne;H={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};re=["(","?"];T={")":["("],":":["?","?:"]};ne=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function ye(e){for(var t=[],r=[],n,i,s,a;n=e.match(ne);){for(i=n[0],s=e.substr(0,n.index).trim(),s&&t.push(s);a=r.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(re.indexOf(a)>=0||H[a]<H[i]){r.push(a);break}t.push(a)}T[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var me={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function _e(e,t){var r=[],n,i,s,a,c,d;for(n=0;n<e.length;n++){if(c=e[n],a=me[c],a){for(i=a.length,s=Array(i);i--;)s[i]=r.pop();try{d=a.apply(null,s)}catch(l){return l}}else t.hasOwnProperty(c)?d=t[c]:d=+c;r.push(d)}return r[0]}function be(e){var t=ye(e);return function(r){return _e(t,r)}}function ve(e){var t=be(e);return function(r){return+t({n:r})}}var q={contextDelimiter:"",onMissingKey:null};function Ee(e){var t,r,n;for(t=e.split(";"),r=0;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function j(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in q)this.options[r]=t!==void 0&&r in t?t[r]:q[r]}j.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,s;return r||(n=this.data[e][""],s=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof s!="function"&&(i=Ee(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),s=ve(i)),r=this.pluralForms[e]=s),r(t)};j.prototype.dcnpgettext=function(e,t,r,n,i){var s,a,c;return i===void 0?s=0:s=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),c=this.data[e][a],c&&c[s]?c[s]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),s===0?r:n)};const K={"":{plural_forms(e){return e===1?0:1}}},xe=/^i18n\.(n?gettext|has_translation)(_|$)/,Ae=(e,t,r)=>{const n=new j({}),i=new Set,s=()=>{i.forEach(u=>u())},a=u=>(i.add(u),()=>i.delete(u)),c=(u="default")=>n.data[u],d=(u,p="default")=>{n.data[p]={...n.data[p],...u},n.data[p][""]={...K[""],...n.data[p]?.[""]},delete n.pluralForms[p]},l=(u,p)=>{d(u,p),s()},w=(u,p="default")=>{n.data[p]={...n.data[p],...u,"":{...K[""],...n.data[p]?.[""],...u?.[""]}},delete n.pluralForms[p],s()},o=(u,p)=>{n.data={},n.pluralForms={},l(u,p)},y=(u="default",p,g,v,E)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,g,v,E)),h=(u="default")=>u,_=(u,p)=>{let g=y(p,void 0,u);return r?(g=r.applyFilters("i18n.gettext",g,u,p),r.applyFilters("i18n.gettext_"+h(p),g,u,p)):g},f=(u,p,g)=>{let v=y(g,p,u);return r?(v=r.applyFilters("i18n.gettext_with_context",v,u,p,g),r.applyFilters("i18n.gettext_with_context_"+h(g),v,u,p,g)):v},A=(u,p,g,v)=>{let E=y(v,void 0,u,p,g);return r?(E=r.applyFilters("i18n.ngettext",E,u,p,g,v),r.applyFilters("i18n.ngettext_"+h(v),E,u,p,g,v)):E},S=(u,p,g,v,E)=>{let k=y(E,v,u,p,g);return r?(k=r.applyFilters("i18n.ngettext_with_context",k,u,p,g,v,E),r.applyFilters("i18n.ngettext_with_context_"+h(E),k,u,p,g,v,E)):k},P=()=>f("ltr","text direction")==="rtl",O=(u,p,g)=>{const v=p?p+""+u:u;let E=!!n.data?.[g??"default"]?.[v];return r&&(E=r.applyFilters("i18n.has_translation",E,u,p,g),E=r.applyFilters("i18n.has_translation_"+h(g),E,u,p,g)),E};if(r){const u=p=>{xe.test(p)&&s()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:c,setLocaleData:l,addLocaleData:w,resetLocaleData:o,subscribe:a,__:_,_x:f,_n:A,_nx:S,isRTL:P,hasTranslation:O}};function ie(e){return typeof e!="string"||e===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function U(e){return typeof e!="string"||e===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function B(e,t){return function(n,i,s,a=10){const c=e[t];if(!U(n)||!ie(i))return;if(typeof s!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:s,priority:a,namespace:i};if(c[n]){const l=c[n].handlers;let w;for(w=l.length;w>0&&!(a>=l[w-1].priority);w--);w===l.length?l[w]=d:l.splice(w,0,d),c.__current.forEach(o=>{o.name===n&&o.currentIndex>=w&&o.currentIndex++})}else c[n]={handlers:[d],runs:0};n!=="hookAdded"&&e.doAction("hookAdded",n,i,s,a)}}function D(e,t,r=!1){return function(i,s){const a=e[t];if(!U(i)||!r&&!ie(s))return;if(!a[i])return 0;let c=0;if(r)c=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===s&&(d.splice(l,1),c++,a.__current.forEach(w=>{w.name===i&&w.currentIndex>=l&&w.currentIndex--}))}return i!=="hookRemoved"&&e.doAction("hookRemoved",i,s),c}}function G(e,t){return function(n,i){const s=e[t];return typeof i<"u"?n in s&&s[n].handlers.some(a=>a.namespace===i):n in s}}function M(e,t,r,n){return function(s,...a){const c=e[t];c[s]||(c[s]={handlers:[],runs:0}),c[s].runs++;const d=c[s].handlers;if(!d||!d.length)return r?a[0]:void 0;const l={name:s,currentIndex:0};async function w(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=await d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}function o(){try{c.__current.add(l);let y=r?a[0]:void 0;for(;l.currentIndex<d.length;)y=d[l.currentIndex].callback.apply(null,a),r&&(a[0]=y),l.currentIndex++;return r?y:void 0}finally{c.__current.delete(l)}}return(n?w:o)()}}function Q(e,t){return function(){var n;const i=e[t];return(n=Array.from(i.__current).at(-1)?.name)!==null&&n!==void 0?n:null}}function J(e,t){return function(n){const i=e[t];return typeof n>"u"?i.__current.size>0:Array.from(i.__current).some(s=>s.name===n)}}function X(e,t){return function(n){const i=e[t];if(U(n))return i[n]&&i[n].runs?i[n].runs:0}}class Se{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=B(this,"actions"),this.addFilter=B(this,"filters"),this.removeAction=D(this,"actions"),this.removeFilter=D(this,"filters"),this.hasAction=G(this,"actions"),this.hasFilter=G(this,"filters"),this.removeAllActions=D(this,"actions",!0),this.removeAllFilters=D(this,"filters",!0),this.doAction=M(this,"actions",!1,!1),this.doActionAsync=M(this,"actions",!1,!0),this.applyFilters=M(this,"filters",!0,!1),this.applyFiltersAsync=M(this,"filters",!0,!0),this.currentAction=Q(this,"actions"),this.currentFilter=Q(this,"filters"),this.doingAction=J(this,"actions"),this.doingFilter=J(this,"filters"),this.didAction=X(this,"actions"),this.didFilter=X(this,"filters")}}function Pe(){return new Se}const Oe=Pe(),b=Ae(void 0,void 0,Oe);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);const L=b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);function Te(e){const t=(r,n)=>{const{headers:i={}}=r;for(const s in i)if(s.toLowerCase()==="x-wp-nonce"&&i[s]===t.nonce)return n(r);return n({...r,headers:{...i,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t}const se=(e,t)=>{let r=e.path,n,i;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(n=e.namespace.replace(/^\/|\/$/g,""),i=e.endpoint.replace(/^\//,""),i?r=n+"/"+i:r=n),delete e.namespace,delete e.endpoint,t({...e,path:r})},Re=e=>(t,r)=>se(t,n=>{let i=n.url,s=n.path,a;return typeof s=="string"&&(a=e,e.indexOf("?")!==-1&&(s=s.replace("?","&")),s=s.replace(/^\//,""),typeof a=="string"&&a.indexOf("?")!==-1&&(s=s.replace("?","&")),i=a+s),r({...n,url:i})});function ke(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch{}if(t)return t}function ae(e){let t="";const r=Object.entries(e);let n;for(;n=r.shift();){let[i,s]=n;if(Array.isArray(s)||s&&s.constructor===Object){const c=Object.entries(s).reverse();for(const[d,l]of c)r.unshift([`${i}[${d}]`,l])}else s!==void 0&&(s===null&&(s=""),t+="&"+[i,s].map(encodeURIComponent).join("="))}return t.substr(1)}function De(e){try{return decodeURIComponent(e)}catch{return e}}function Me(e,t,r){const n=t.length,i=n-1;for(let s=0;s<n;s++){let a=t[s];!a&&Array.isArray(e)&&(a=e.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;const c=!isNaN(Number(t[s+1]));e[a]=s===i?r:e[a]||(c?[]:{}),Array.isArray(e[a])&&!c&&(e[a]={...e[a]}),e=e[a]}}function F(e){return(ke(e)||"").replace(/\+/g,"%20").split("&").reduce((t,r)=>{const[n,i=""]=r.split("=").filter(Boolean).map(De);if(n){const s=n.replace(/\]/g,"").split("[");Me(t,s,i)}return t},Object.create(null))}function x(e="",t){if(!t||!Object.keys(t).length)return e;let r=e;const n=e.indexOf("?");return n!==-1&&(t=Object.assign(F(e),t),r=r.substr(0,n)),r+"?"+ae(t)}function I(e,t){return F(e)[t]}function V(e,t){return I(e,t)!==void 0}function Z(e,...t){const r=e.indexOf("?");if(r===-1)return e;const n=F(e),i=e.substr(0,r);t.forEach(a=>delete n[a]);const s=ae(n);return s?i+"?"+s:i}function W(e){const t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map(i=>i.split("=")).map(i=>i.map(decodeURIComponent)).sort((i,s)=>i[0].localeCompare(s[0])).map(i=>i.map(encodeURIComponent)).map(i=>i.join("=")).join("&"):n}function Le(e){const t=Object.fromEntries(Object.entries(e).map(([r,n])=>[W(r),n]));return(r,n)=>{const{parse:i=!0}=r;let s=r.path;if(!s&&r.url){const{rest_route:d,...l}=F(r.url);typeof d=="string"&&(s=x(d,l))}if(typeof s!="string")return n(r);const a=r.method||"GET",c=W(s);if(a==="GET"&&t[c]){const d=t[c];return delete t[c],Y(d,!!i)}else if(a==="OPTIONS"&&t[a]&&t[a][c]){const d=t[a][c];return delete t[a][c],Y(d,!!i)}return n(r)}}function Y(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}const Fe=({path:e,url:t,...r},n)=>({...r,url:t&&x(t,n),path:e&&x(e,n)}),ee=e=>e.json?e.json():Promise.reject(e),Ce=e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}},te=e=>{const{next:t}=Ce(e.headers.get("link"));return t},He=e=>{const t=!!e.path&&e.path.indexOf("per_page=-1")!==-1,r=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return t||r},oe=async(e,t)=>{if(e.parse===!1||!He(e))return t(e);const r=await m({...Fe(e,{per_page:100}),parse:!1}),n=await ee(r);if(!Array.isArray(n))return n;let i=te(r);if(!i)return n;let s=[].concat(n);for(;i;){const a=await m({...e,path:void 0,url:i,parse:!1}),c=await ee(a);s=s.concat(c),i=te(a)}return s},Ie=new Set(["PATCH","PUT","DELETE"]),je="GET",Ue=(e,t)=>{const{method:r=je}=e;return Ie.has(r.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":r,"Content-Type":"application/json"},method:"POST"}),t(e)},$e=(e,t)=>(typeof e.url=="string"&&!V(e.url,"_locale")&&(e.url=x(e.url,{_locale:"user"})),typeof e.path=="string"&&!V(e.path,"_locale")&&(e.path=x(e.path,{_locale:"user"})),t(e)),Ne=(e,t=!0)=>t?e.status===204?null:e.json?e.json():Promise.reject(e):e,ze=e=>{const t={code:"invalid_json",message:L("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},ce=(e,t=!0)=>Promise.resolve(Ne(e,t)).catch(r=>$(r,t));function $(e,t=!0){if(!t)throw e;return ze(e).then(r=>{const n={code:"unknown_error",message:L("An unknown error occurred.")};throw r||n})}function qe(e){const t=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&t}const Ke=(e,t)=>{if(!qe(e))return t(e);let r=0;const n=5,i=s=>(r++,t({path:`/wp/v2/media/${s}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>r<n?i(s):(t({path:`/wp/v2/media/${s}?force=true`,method:"DELETE"}),Promise.reject())));return t({...e,parse:!1}).catch(s=>{if(!s.headers)return Promise.reject(s);const a=s.headers.get("x-wp-upload-attachment-id");return s.status>=500&&s.status<600&&a?i(a).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:L("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(s)):$(s,e.parse)}).then(s=>ce(s,e.parse))},Be=e=>(t,r)=>{if(typeof t.url=="string"){const n=I(t.url,"wp_theme_preview");n===void 0?t.url=x(t.url,{wp_theme_preview:e}):n===""&&(t.url=Z(t.url,"wp_theme_preview"))}if(typeof t.path=="string"){const n=I(t.path,"wp_theme_preview");n===void 0?t.path=x(t.path,{wp_theme_preview:e}):n===""&&(t.path=Z(t.path,"wp_theme_preview"))}return r(t)},Ge={Accept:"application/json, */*;q=0.1"},Qe={credentials:"include"},le=[$e,se,Ue,oe];function Je(e){le.unshift(e)}const ue=e=>{if(e.status>=200&&e.status<300)return e;throw e},Xe=e=>{const{url:t,path:r,data:n,parse:i=!0,...s}=e;let{body:a,headers:c}=e;return c={...Ge,...c},n&&(a=JSON.stringify(n),c["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,{...Qe,...s,body:a,headers:c}).then(l=>Promise.resolve(l).then(ue).catch(w=>$(w,i)).then(w=>ce(w,i)),l=>{throw l&&l.name==="AbortError"?l:{code:"fetch_error",message:L("You are probably offline.")}})};let de=Xe;function Ve(e){de=e}function m(e){return le.reduceRight((r,n)=>i=>n(i,r),de)(e).catch(r=>r.code!=="rest_cookie_invalid_nonce"?Promise.reject(r):window.fetch(m.nonceEndpoint).then(ue).then(n=>n.text()).then(n=>(m.nonceMiddleware.nonce=n,m(e))))}m.use=Je;m.setFetchHandler=Ve;m.createNonceMiddleware=Te;m.createPreloadingMiddleware=Le;m.createRootURLMiddleware=Re;m.fetchAllMiddleware=oe;m.mediaUploadMiddleware=Ke;m.createThemePreviewMiddleware=Be;function ut(){window.editorDelegate&&window.editorDelegate.onEditorLoaded(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorLoaded",body:{}})}function dt(){window.editorDelegate&&window.editorDelegate.onEditorContentChanged(),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorContentChanged"})}function ft(e,t){window.editorDelegate&&window.editorDelegate.onEditorHistoryChanged(e,t),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"onEditorHistoryChanged",body:{hasUndo:e,hasRedo:t}})}function pt(e){window.editorDelegate&&window.editorDelegate.openMediaLibrary(JSON.stringify(e)),window.webkit&&window.webkit.messageHandlers.editorDelegate.postMessage({message:"openMediaLibrary",body:e})}function R(){if(window.GBKit)return window.GBKit;if(window.editorDelegate)try{return JSON.parse(window.editorDelegate.getEditorConfiguration())}catch{return{}}try{return JSON.parse(localStorage.getItem("GBKit"))||{}}catch{return{}}}function Ze(){const{post:e}=R();return e?{id:e.id,title:{raw:decodeURIComponent(e.title)},content:{raw:decodeURIComponent(e.content)},type:e.type||"post"}:{type:"post",status:"draft",id:-1}}function We(){const{siteApiRoot:e="",authHeader:t}=R();m.use(m.createRootURLMiddleware(e)),m.use(Ye),m.use(et),m.use(tt(t)),m.use(rt),m.use(nt),m.use(m.createPreloadingMiddleware({"/wp/v2/types?context=view":{body:{post:{description:"",hierarchical:!1,has_archive:!1,name:"Posts",slug:"post",taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}},page:{description:"",hierarchical:!0,has_archive:!1,name:"Pages",slug:"page",taxonomies:[],rest_base:"pages",rest_namespace:"wp/v2",template:[],template_lock:!1,_links:{}}}},"/wp/v2/types/post?context=edit":{body:{name:"Posts",slug:"post",supports:{title:!0,editor:!0,author:!0,thumbnail:!0,excerpt:!0,trackbacks:!0,"custom-fields":!0,comments:!0,revisions:!0,"post-formats":!0,autosave:!0},taxonomies:["category","post_tag"],rest_base:"posts",rest_namespace:"wp/v2",template:[],template_lock:!1}}}))}function Ye(e,t){return e.mode="cors",delete e.headers["x-wp-api-fetch-from-editor"],t(e)}function et(e,t){const{siteApiNamespace:r}=R();return e.path&&r&&!e.path.includes(r)&&(e.path=e.path.replace(/^(?<apiPath>\/?(?:[\w.-]+\/){2})/,`$<apiPath>${r}/`)),t(e)}function tt(e){return(t,r)=>(t.headers=t.headers||{},e&&(t.headers.Authorization=e),r(t))}function rt(e,t){return[/^\/wp\/v2\/posts\/-?\d+/,/^\/wp\/v2\/pages\/-?\d+/].some(i=>i.test(e.path))?Promise.resolve([]):t(e)}function nt(e,t){return e.path&&e.path.startsWith("/wp/v2/media")&&e.method==="POST"&&e.body instanceof FormData&&e.body.get("post")==="-1"&&e.body.delete("post"),t(e)}window.GBKit=R();window.wp=window.wp||{};window.wp.apiFetch=m;We();it();async function it(){try{const{themeStyles:e,siteURL:t}=R(),{styles:r,scripts:n}=await m({url:`${t}/wp-json/__experimental/wp-block-editor/v1/editor-assets`});await st([...r,...n].join(""));const{dispatch:i}=window.wp.data,{store:s}=window.wp.editor,{store:a}=window.wp.preferences;m({path:"/wp-block-editor/v1/settings"}).then(h=>{i(s).updateEditorSettings(h)}).catch(()=>{const h={defaultEditorStyles:[{css:fe}]};i(s).updateEditorSettings(h)}),i(a).setDefaults("core/edit-post",{themeStyles:e});const d={post:Ze()},{default:l}=await we(async()=>{const{default:h}=await import("./index-BIS0DtaD.js");return{default:h}},__vite__mapDeps([0,1]),import.meta.url),{createRoot:w,createElement:o,StrictMode:y}=window.wp.element;w(document.getElementById("root")).render(o(y,null,o(l,d)))}catch{window.location.href="index.html?error=remote_editor_load_error"}}async function st(e){const t=new window.DOMParser().parseFromString(e,"text/html"),r=Array.from(t.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!ot.test(n.src));for(const n of r)await ct(n)}const at=["api-fetch"],ot=new RegExp(at.flatMap(e=>[`wp-content/plugins/gutenberg/build/${e.replace(/\//g,"\\/")}\\b`,`wp-includes/js/dist/${e.replace(/\//g,"\\/")}\\b`]).join("|"));function ct(e){return new Promise(t=>{const r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>{t(!1)},document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()})}export{dt as a,pt as b,ut as e,ft as o};

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Copilot Autofix AI about 13 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants