(()=>{"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}wp.apiFetch.use((function(t,r){if(!t.path||"PUT"!==t.method&&"POST"!==t.method)return r(t);var n=wp.data.select("core/editor");if(!n)return r(t);var o=n.getCurrentPost();if(!o.hasOwnProperty("type"))return r(t);var a=wp.data.select("core").getPostType(o.type);if(!a.hasOwnProperty("rest_base"))return r(t);var i="/wp/v2/"+a.rest_base+"/"+o.id;return t.path.startsWith(i)&&"PUT"===t.method||t.path.startsWith(i+"/autosaves")&&"POST"===t.method?o.hasOwnProperty("qtx_editor_lang")?r(e(e({},t),{},{data:e(e({},t.data),{},{qtx_editor_lang:o.qtx_editor_lang})})):(console.log("QT-XT API: missing field [qtx_editor_lang] in post id="+o.id),r(t)):r(t)}))})();