var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ut(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}function J(t,e){var r=0,n,s;e=e||{};function a(){var o=n,l=arguments.length,d,c;t:for(;o;){if(o.args.length!==arguments.length){o=o.next;continue}for(c=0;c=0),f.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,f.width?parseInt(f.width):0);break;case"e":i=f.precision?parseFloat(i).toExponential(f.precision):parseFloat(i).toExponential();break;case"f":i=f.precision?parseFloat(i).toFixed(f.precision):parseFloat(i);break;case"g":i=f.precision?String(Number(i.toPrecision(f.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=f.precision?i.substring(0,f.precision):i;break;case"t":i=String(!!i),i=f.precision?i.substring(0,f.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=f.precision?i.substring(0,f.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=f.precision?i.substring(0,f.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?w+=i:(e.number.test(f.type)&&(!S||f.sign)?(u=S?"+":"-",i=i.toString().replace(e.sign,"")):u="",m=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",E=f.width-(u+i).length,A=f.width&&E>0?m.repeat(E):"",w+=f.align?u+i+A:m==="0"?u+A+i:A+u+i)}return w}var a=Object.create(null);function o(l){if(a[l])return a[l];for(var d=l,c,_=[],i=0;d;){if((c=e.text.exec(d))!==null)_.push(c[0]);else if((c=e.modulo.exec(d))!==null)_.push("%");else if((c=e.placeholder.exec(d))!==null){if(c[2]){i|=1;var w=[],y=c[2],x=[];if((x=e.key.exec(y))!==null)for(w.push(x[1]);(y=y.substring(x[0].length))!=="";)if((x=e.key_access.exec(y))!==null)w.push(x[1]);else if((x=e.index_access.exec(y))!==null)w.push(x[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");c[2]=w}else i|=2;if(i===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");_.push({placeholder:c[0],param_no:c[1],keys:c[2],sign:c[3],pad_char:c[4],align:c[5],width:c[6],precision:c[7],type:c[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(c[0].length)}return a[l]=_}t.sprintf=r,t.vsprintf=n,typeof window<"u"&&(window.sprintf=r,window.vsprintf=n)})()})(K);const q=G(K),B=J(console.error);function at(t,...e){try{return q.sprintf(t,...e)}catch(r){return r instanceof Error&&B(`sprintf error: `+r.toString()),t}}var k,U,O,X;k={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};U=["(","?"];O={")":["("],":":["?","?:"]};X=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Q(t){for(var e=[],r=[],n,s,a,o;n=t.match(X);){for(s=n[0],a=t.substr(0,n.index).trim(),a&&e.push(a);o=r.pop();){if(O[s]){if(O[s][0]===o){s=O[s][1]||s;break}}else if(U.indexOf(o)>=0||k[o]":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function W(t,e){var r=[],n,s,a,o,l,d;for(n=0;n{const n=new D({}),s=new Set,a=()=>{s.forEach(u=>u())},o=u=>(s.add(u),()=>s.delete(u)),l=(u="default")=>n.data[u],d=(u,p="default")=>{var h;n.data[p]={...n.data[p],...u},n.data[p][""]={...L[""],...(h=n.data[p])==null?void 0:h[""]},delete n.pluralForms[p]},c=(u,p)=>{d(u,p),a()},_=(u,p="default")=>{var h;n.data[p]={...n.data[p],...u,"":{...L[""],...(h=n.data[p])==null?void 0:h[""],...u==null?void 0:u[""]}},delete n.pluralForms[p],a()},i=(u,p)=>{n.data={},n.pluralForms={},c(u,p)},w=(u="default",p,h,b,v)=>(n.data[u]||d(void 0,u),n.dcnpgettext(u,p,h,b,v)),y=(u="default")=>u,x=(u,p)=>{let h=w(p,void 0,u);return r?(h=r.applyFilters("i18n.gettext",h,u,p),r.applyFilters("i18n.gettext_"+y(p),h,u,p)):h},f=(u,p,h)=>{let b=w(h,p,u);return r?(b=r.applyFilters("i18n.gettext_with_context",b,u,p,h),r.applyFilters("i18n.gettext_with_context_"+y(h),b,u,p,h)):b},A=(u,p,h,b)=>{let v=w(b,void 0,u,p,h);return r?(v=r.applyFilters("i18n.ngettext",v,u,p,h,b),r.applyFilters("i18n.ngettext_"+y(b),v,u,p,h,b)):v},m=(u,p,h,b,v)=>{let F=w(v,b,u,p,h);return r?(F=r.applyFilters("i18n.ngettext_with_context",F,u,p,h,b,v),r.applyFilters("i18n.ngettext_with_context_"+y(v),F,u,p,h,b,v)):F},E=()=>f("ltr","text direction")==="rtl",S=(u,p,h)=>{var F,j;const b=p?p+""+u:u;let v=!!((j=(F=n.data)==null?void 0:F[h??"default"])!=null&&j[b]);return r&&(v=r.applyFilters("i18n.has_translation",v,u,p,h),v=r.applyFilters("i18n.has_translation_"+y(h),v,u,p,h)),v};if(r){const u=p=>{et.test(p)&&a()};r.addAction("hookAdded","core/i18n",u),r.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:l,setLocaleData:c,addLocaleData:_,resetLocaleData:i,subscribe:o,__:x,_x:f,_n:A,_nx:m,isRTL:E,hasTranslation:S}};function Z(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function R(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function P(t,e){return function(n,s,a,o=10){const l=t[e];if(!R(n)||!Z(s))return;if(typeof a!="function"){console.error("The hook callback must be a function.");return}if(typeof o!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:a,priority:o,namespace:s};if(l[n]){const c=l[n].handlers;let _;for(_=c.length;_>0&&!(o>=c[_-1].priority);_--);_===c.length?c[_]=d:c.splice(_,0,d),l.__current.forEach(i=>{i.name===n&&i.currentIndex>=_&&i.currentIndex++})}else l[n]={handlers:[d],runs:0};n!=="hookAdded"&&t.doAction("hookAdded",n,s,a,o)}}function T(t,e,r=!1){return function(s,a){const o=t[e];if(!R(s)||!r&&!Z(a))return;if(!o[s])return 0;let l=0;if(r)l=o[s].handlers.length,o[s]={runs:o[s].runs,handlers:[]};else{const d=o[s].handlers;for(let c=d.length-1;c>=0;c--)d[c].namespace===a&&(d.splice(c,1),l++,o.__current.forEach(_=>{_.name===s&&_.currentIndex>=c&&_.currentIndex--}))}return s!=="hookRemoved"&&t.doAction("hookRemoved",s,a),l}}function I(t,e){return function(n,s){const a=t[e];return typeof s<"u"?n in a&&a[n].handlers.some(o=>o.namespace===s):n in a}}function z(t,e,r=!1){return function(s,...a){const o=t[e];o[s]||(o[s]={handlers:[],runs:0}),o[s].runs++;const l=o[s].handlers;if(!l||!l.length)return r?a[0]:void 0;const d={name:s,currentIndex:0};for(o.__current.push(d);d.currentIndex"u"?typeof s.__current[0]<"u":s.__current[0]?n===s.__current[0].name:!1}}function $(t,e){return function(n){const s=t[e];if(R(n))return s[n]&&s[n].runs?s[n].runs:0}}class rt{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=P(this,"actions"),this.addFilter=P(this,"filters"),this.removeAction=T(this,"actions"),this.removeFilter=T(this,"filters"),this.hasAction=I(this,"actions"),this.hasFilter=I(this,"filters"),this.removeAllActions=T(this,"actions",!0),this.removeAllFilters=T(this,"filters",!0),this.doAction=z(this,"actions"),this.applyFilters=z(this,"filters",!0),this.currentAction=C(this,"actions"),this.currentFilter=C(this,"filters"),this.doingAction=M(this,"actions"),this.doingFilter=M(this,"filters"),this.didAction=$(this,"actions"),this.didFilter=$(this,"filters")}}function it(){return new rt}const st=it(),g=nt(void 0,void 0,st);g.getLocaleData.bind(g);const ct=g.setLocaleData.bind(g);g.resetLocaleData.bind(g);g.subscribe.bind(g);const lt=g.__.bind(g);g._x.bind(g);const ft=g._n.bind(g);g._nx.bind(g);const pt=g.isRTL.bind(g);g.hasTranslation.bind(g);export{lt as _,at as a,ft as b,ot as c,ut as d,G as g,pt as i,ct as s};