initial
This commit is contained in:
commit
9883323161
17470 files changed
+4470592
No files matched your search
@@ -0,0 +1,49 @@
|
||||
// packages/a11y/build-module/shared/clear.mjs
|
||||
function clear() {
|
||||
const regions = document.getElementsByClassName("a11y-speak-region");
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
for (let i = 0; i < regions.length; i++) {
|
||||
regions[i].textContent = "";
|
||||
}
|
||||
if (introText) {
|
||||
introText.setAttribute("hidden", "hidden");
|
||||
}
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/shared/filter-message.mjs
|
||||
var previousMessage = "";
|
||||
function filterMessage(message) {
|
||||
message = message.replace(/<[^<>]+>/g, " ");
|
||||
if (previousMessage === message) {
|
||||
message += "\xA0";
|
||||
}
|
||||
previousMessage = message;
|
||||
return message;
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/shared/index.mjs
|
||||
function speak(message, ariaLive) {
|
||||
clear();
|
||||
message = filterMessage(message);
|
||||
const introText = document.getElementById("a11y-speak-intro-text");
|
||||
const containerAssertive = document.getElementById(
|
||||
"a11y-speak-assertive"
|
||||
);
|
||||
const containerPolite = document.getElementById("a11y-speak-polite");
|
||||
if (containerAssertive && ariaLive === "assertive") {
|
||||
containerAssertive.textContent = message;
|
||||
} else if (containerPolite) {
|
||||
containerPolite.textContent = message;
|
||||
}
|
||||
if (introText) {
|
||||
introText.removeAttribute("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
// packages/a11y/build-module/module/index.mjs
|
||||
var setup = () => {
|
||||
};
|
||||
export {
|
||||
setup,
|
||||
speak
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '1c371cb517a97cdbcb9f');
|
||||
@@ -0,0 +1 @@
|
||||
function i(){let t=document.getElementsByClassName("a11y-speak-region"),n=document.getElementById("a11y-speak-intro-text");for(let e=0;e<t.length;e++)t[e].textContent="";n&&n.setAttribute("hidden","hidden")}var a="";function c(t){return t=t.replace(/<[^<>]+>/g," "),a===t&&(t+="\xA0"),a=t,t}function l(t,n){i(),t=c(t);let e=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&n==="assertive"?o.textContent=t:r&&(r.textContent=t),e&&e.removeAttribute("hidden")}var m=()=>{};export{m as setup,l as speak};
|
||||
+7644
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => 'f3475bc77a30dcc5b38d');
|
||||
@@ -0,0 +1,8 @@
|
||||
var Xo=Object.create;var Or=Object.defineProperty;var Qo=Object.getOwnPropertyDescriptor;var eu=Object.getOwnPropertyNames;var tu=Object.getPrototypeOf,ru=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jn=(e,t)=>{for(var r in t)Or(e,r,{get:t[r],enumerable:!0})},su=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of eu(t))!ru.call(e,n)&&n!==r&&Or(e,n,{get:()=>t[n],enumerable:!(s=Qo(t,n))||s.enumerable});return e};var we=(e,t,r)=>(r=e!=null?Xo(tu(e)):{},su(t||!e||!e.__esModule?Or(r,"default",{value:e,enumerable:!0}):r,e));var ot=y((Yp,Wn)=>{Wn.exports=window.wp.data});var kr=y((Bp,Zn)=>{Zn.exports=window.wp.i18n});var dt=y(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.regexpCode=k.getEsmExportName=k.getProperty=k.safeStringify=k.stringify=k.strConcat=k.addCodeArg=k.str=k._=k.nil=k._Code=k.Name=k.IDENTIFIER=k._CodeOrName=void 0;var ut=class{};k._CodeOrName=ut;k.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var qe=class extends ut{constructor(t){if(super(),!k.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};k.Name=qe;var W=class extends ut{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,s)=>(s instanceof qe&&(r[s.str]=(r[s.str]||0)+1),r),{})}};k._Code=W;k.nil=new W("");function sa(e,...t){let r=[e[0]],s=0;for(;s<t.length;)Mr(r,t[s]),r.push(e[++s]);return new W(r)}k._=sa;var Cr=new W("+");function na(e,...t){let r=[ct(e[0])],s=0;for(;s<t.length;)r.push(Cr),Mr(r,t[s]),r.push(Cr,ct(e[++s]));return vu(r),new W(r)}k.str=na;function Mr(e,t){t instanceof W?e.push(...t._items):t instanceof qe?e.push(t):e.push(Eu(t))}k.addCodeArg=Mr;function vu(e){let t=1;for(;t<e.length-1;){if(e[t]===Cr){let r=wu(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function wu(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof qe||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof qe))return`"${e}${t.slice(1)}`}function bu(e,t){return t.emptyStr()?e:e.emptyStr()?t:na`${e}${t}`}k.strConcat=bu;function Eu(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ct(Array.isArray(e)?e.join(","):e)}function Su(e){return new W(ct(e))}k.stringify=Su;function ct(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}k.safeStringify=ct;function Pu(e){return typeof e=="string"&&k.IDENTIFIER.test(e)?new W(`.${e}`):sa`[${e}]`}k.getProperty=Pu;function Tu(e){if(typeof e=="string"&&k.IDENTIFIER.test(e))return new W(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}k.getEsmExportName=Tu;function Iu(e){return new W(e.toString())}k.regexpCode=Iu});var Vr=y(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.ValueScope=Y.ValueScopeName=Y.Scope=Y.varKinds=Y.UsedValueState=void 0;var H=dt(),Dr=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Ut;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Ut||(Y.UsedValueState=Ut={}));Y.varKinds={const:new H.Name("const"),let:new H.Name("let"),var:new H.Name("var")};var Ft=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof H.Name?t:this.name(t)}name(t){return new H.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};Y.Scope=Ft;var Kt=class extends H.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:s}){this.value=t,this.scopePath=(0,H._)`.${new H.Name(r)}[${s}]`}};Y.ValueScopeName=Kt;var Nu=(0,H._)`\n`,zr=class extends Ft{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Nu:H.nil}}get(){return this._scope}name(t){return new Kt(t,this._newName(t))}value(t,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(t),{prefix:a}=n,i=(s=r.key)!==null&&s!==void 0?s:r.ref,o=this._values[a];if(o){let c=o.get(i);if(c)return c}else o=this._values[a]=new Map;o.set(i,n);let u=this._scope[a]||(this._scope[a]=[]),d=u.length;return u[d]=r.ref,n.setValue(r,{property:a,itemIndex:d}),n}getValueLine truncated
|
||||
`:""},this._extScope=t,this._scope=new te.Scope({parent:t}),this._nodes=[new Hr]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let s=this._extScope.value(t,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,s,n){let a=this._scope.toName(r);return s!==void 0&&n&&(this._constants[a.str]=s),this._leafNode(new xr(t,a,s)),a}const(t,r,s){return this._def(te.varKinds.const,t,r,s)}let(t,r,s){return this._def(te.varKinds.let,t,r,s)}var(t,r,s){return this._def(te.varKinds.var,t,r,s)}assign(t,r,s){return this._leafNode(new Gt(t,r,s))}add(t,r){return this._leafNode(new Lr(t,S.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==I.nil&&this._leafNode(new Gr(t)),this}object(...t){let r=["{"];for(let[s,n]of t)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,I.addCodeArg)(r,n));return r.push("}"),new I._Code(r)}if(t,r,s){if(this._blockNode(new Re(t)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Re(t))}else(){return this._elseNode(new Le)}endIf(){return this._endBlockNode(Re,Le)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Yr(t),r)}forRange(t,r,s,n,a=this.opts.es5?te.varKinds.var:te.varKinds.let){let i=this._scope.toName(t);return this._for(new Br(a,i,r,s),()=>n(i))}forOf(t,r,s,n=te.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let i=r instanceof I.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,I._)`${i}.length`,o=>{this.var(a,(0,I._)`${i}[${o}]`),s(a)})}return this._for(new Ht("of",n,a,r),()=>s(a))}forIn(t,r,s,n=this.opts.es5?te.varKinds.var:te.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,I._)`Object.keys(${r})`,s);let a=this._scope.toName(t);return this._for(new Ht("in",n,a,r),()=>s(a))}endFor(){return this._endBlockNode(je)}label(t){return this._leafNode(new Ur(t))}break(t){return this._leafNode(new Fr(t))}return(t){let r=new mt;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(mt)}try(t,r,s){if(!r&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Jr;if(this._blockNode(n),this.code(t),r){let a=this.name("e");this._currNode=n.catch=new pt(a),r(a)}return s&&(this._currNode=n.finally=new ht,this.code(s)),this._endBlockNode(pt,ht)}throw(t){return this._leafNode(new Kr(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-r;if(s<0||t!==void 0&&s!==t)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=I.nil,s,n){return this._blockNode(new ft(t,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(ft)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let s=this._currNode;if(s instanceof t||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Re))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};S.CodeGen=Wr;function Ae(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Yt(e,t){return t instanceof I._CodeOrName?Ae(e,t.names):e}function Ue(e,t,r){if(e instanceof I.Name)return s(e);if(!n(e))return e;return new I._Code(e._items.reduce((a,i)=>(i instanceof I.Name&&(i=s(i)),i instanceof I._Code?a.push(...i._items):a.push(i),a),[]));function s(a){let i=r[a.str];return i===void 0||t[a.str]!==1?a:(delete t[a.str],i)}function n(a){return a instanceof I._Code&&a._items.some(i=>i instanceof I.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function Ou(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function aa(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,I._)`!${Zr(e)}`}S.not=aa;var ku=ia(S.operators.AND);function qu(...e){return e.reduce(ku)}S.and=qu;var Ru=ia(S.operators.OR);function ju(...e){return e.reduce(Ru)}S.or=ju;function ia(e){return(t,r)=>t===I.nil?r:r===I.nil?t:(0,I._)`${Zr(t)} ${e} ${Zr(r)}`}function Zr(e){return e instanceof I.Name?e:(0,I._)`(${e})`}});var q=y(P=>{"use str
Line truncated
|
||||
|| (${i} == "string" && ${n} && ${n} == +${n})`).assign(o,(0,E._)`+${n}`);return;case"integer":s.elseIf((0,E._)`${i} === "boolean" || ${n} === null
|
||||
|| (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(o,(0,E._)`+${n}`);return;case"boolean":s.elseIf((0,E._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(o,!1).elseIf((0,E._)`${n} === "true" || ${n} === 1`).assign(o,!0);return;case"null":s.elseIf((0,E._)`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(o,null);return;case"array":s.elseIf((0,E._)`${i} === "string" || ${i} === "number"
|
||||
|| ${i} === "boolean" || ${n} === null`).assign(o,(0,E._)`[${n}]`)}}}function _c({gen:e,parentData:t,parentDataProperty:r},s){e.if((0,E._)`${t} !== undefined`,()=>e.assign((0,E._)`${t}[${r}]`,s))}function ns(e,t,r,s=Ge.Correct){let n=s===Ge.Correct?E.operators.EQ:E.operators.NEQ,a;switch(e){case"null":return(0,E._)`${t} ${n} null`;case"array":a=(0,E._)`Array.isArray(${t})`;break;case"object":a=(0,E._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=i((0,E._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=i();break;default:return(0,E._)`typeof ${t} ${n} ${e}`}return s===Ge.Correct?a:(0,E.not)(a);function i(o=E.nil){return(0,E.and)((0,E._)`typeof ${t} == "number"`,o,r?(0,E._)`isFinite(${t})`:E.nil)}}F.checkDataType=ns;function as(e,t,r,s){if(e.length===1)return ns(e[0],t,r,s);let n,a=(0,wa.toHash)(e);if(a.array&&a.object){let i=(0,E._)`typeof ${t} != "object"`;n=a.null?i:(0,E._)`!${t} || ${i}`,delete a.null,delete a.array,delete a.object}else n=E.nil;a.number&&delete a.integer;for(let i in a)n=(0,E.and)(n,ns(i,t,r,s));return n}F.checkDataTypes=as;var gc={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,E._)`{type: ${e}}`:(0,E._)`{type: ${t}}`};function is(e){let t=$c(e);(0,fc.reportError)(t,gc)}F.reportTypeError=is;function $c(e){let{gen:t,data:r,schema:s}=e,n=(0,wa.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:n,schemaValue:n,parentSchema:s,params:{},it:e}}});var Pa=y(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.assignDefaults=void 0;var He=b(),vc=q();function wc(e,t){let{properties:r,items:s}=e.schema;if(t==="object"&&r)for(let n in r)Sa(e,n,r[n].default);else t==="array"&&Array.isArray(s)&&s.forEach((n,a)=>Sa(e,a,n.default))}Wt.assignDefaults=wc;function Sa(e,t,r){let{gen:s,compositeRule:n,data:a,opts:i}=e;if(r===void 0)return;let o=(0,He._)`${a}${(0,He.getProperty)(t)}`;if(n){(0,vc.checkStrictMode)(e,`default is ignored for: ${o}`);return}let u=(0,He._)`${o} === undefined`;i.useDefaults==="empty"&&(u=(0,He._)`${u} || ${o} === null || ${o} === ""`),s.if(u,(0,He._)`${o} = ${(0,He.stringify)(r)}`)}});var Z=y(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.validateUnion=R.validateArray=R.usePattern=R.callValidateCode=R.schemaProperties=R.allSchemaProperties=R.noPropertyInData=R.propertyInData=R.isOwnProperty=R.hasPropFunc=R.reportMissingProp=R.checkMissingProp=R.checkReportMissingProp=void 0;var C=b(),os=q(),Se=ge(),bc=q();function Ec(e,t){let{gen:r,data:s,it:n}=e;r.if(cs(r,s,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,C._)`${t}`},!0),e.error()})}R.checkReportMissingProp=Ec;function Sc({gen:e,data:t,it:{opts:r}},s,n){return(0,C.or)(...s.map(a=>(0,C.and)(cs(e,t,a,r.ownProperties),(0,C._)`${n} = ${a}`)))}R.checkMissingProp=Sc;function Pc(e,t){e.setParams({missingProperty:t},!0),e.error()}R.reportMissingProp=Pc;function Ta(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,C._)`Object.prototype.hasOwnProperty`})}R.hasPropFunc=Ta;function us(e,t,r){return(0,C._)`${Ta(e)}.call(${t}, ${r})`}R.isOwnProperty=us;function Tc(e,t,r,s){let n=(0,C._)`${t}${(0,C.getProperty)(r)} !== undefined`;return s?(0,C._)`${n} && ${us(e,t,r)}`:n}R.propertyInData=Tc;function cs(e,t,r,s){let n=(0,C._)`${t}${(0,C.getProperty)(r)} === undefined`;return s?(0,C.or)(n,(0,C.not)(us(e,t,r))):n}R.noPropertyInData=cs;function Ia(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}R.allSchemaProperties=Ia;function Ic(e,t){return Ia(t).filter(r=>!(0,os.alwaysValidSchema)(e,t[r]))}R.schemaProperties=Ic;function Nc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:n,errorPath:a},it:i},o,u,d){let c=d?(0,C._)`${e}, ${t}, ${s}${n}`:t,l=[[Se.default.instancePath,(0,C.strConcat)(Se.default.instancePath,a)],[Se.default.parentData,i.parentData],[Se.default.parentDataProperty,i.parentDataProperty],[Se.default.rootData,Se.default.rootData]];i.opts.dynamicRef&&l.push([Se.default.dynamicAnchors,Se.default.dynamicAnchors]);let h=(0,C._)`${c}, ${r.object(...l)}`;return u!==C.nil?(0,C._)`${o}.call(${u}, ${h})`:(0,C._)`${o}(${h})`}R.callValidateCode=Nc;var Oc=(0,C._)`new RegExp`;function kc({gen:e,it:{opts:t}},r){let s=t.unicodeRegExp?"u":"",{regExp:n}=t.code,a=n(r,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,C._)`${n.code==="new RegExp"?Oc:(0,bc.useFunc)(e,n)}(${r}, ${s})`})}R.usePattern=kc;function qc(e){let{gen:t,data:r,keyword:s,it:n}=e,a=t.name("valid");if(n.allErrors){let o=t.let("valid",!0);return i(()=>t.assign(o,!1)),o}return t.var(a,!0),i(()=>t.break()),a;function i(o){let u=t.const("len",(0,C._)`${r}.length`);t.forRange("i",0,u,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:os.Type.Num},a),t.if((0,C.not)(a),o)})}}R.validateArray=qc;function Rc(e){let{gen:t,schema:r,keyword:s,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,os.alwaysValidSchema)(n,u))&&!n.opts
Line truncated
|
||||
missingProperty: ${s},
|
||||
depsCount: ${t},
|
||||
deps: ${r}}`};var Df={keyword:"dependencies",type:"object",schemaType:"object",error:de.error,code(e){let[t,r]=zf(e);Yi(e,t),Bi(e,r)}};function zf({schema:e}){let t={},r={};for(let s in e){if(s==="__proto__")continue;let n=Array.isArray(e[s])?t:r;n[s]=e[s]}return[t,r]}function Yi(e,t=e.schema){let{gen:r,data:s,it:n}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let i in t){let o=t[i];if(o.length===0)continue;let u=(0,Ct.propertyInData)(r,s,i,n.opts.ownProperties);e.setParams({property:i,depsCount:o.length,deps:o.join(", ")}),n.allErrors?r.if(u,()=>{for(let d of o)(0,Ct.checkReportMissingProp)(e,d)}):(r.if((0,fn._)`${u} && (${(0,Ct.checkMissingProp)(e,o,a)})`),(0,Ct.reportMissingProp)(e,a),r.else())}}de.validatePropertyDeps=Yi;function Bi(e,t=e.schema){let{gen:r,data:s,keyword:n,it:a}=e,i=r.name("valid");for(let o in t)(0,Mf.alwaysValidSchema)(a,t[o])||(r.if((0,Ct.propertyInData)(r,s,o,a.opts.ownProperties),()=>{let u=e.subschema({keyword:n,schemaProp:o},i);e.mergeValidEvaluated(u,i)},()=>r.var(i,!0)),e.ok(i))}de.validateSchemaDeps=Bi;de.default=Df});var Zi=y(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});var Wi=b(),Vf=q(),xf={message:"property name must be valid",params:({params:e})=>(0,Wi._)`{propertyName: ${e.propertyName}}`},Lf={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xf,code(e){let{gen:t,schema:r,data:s,it:n}=e;if((0,Vf.alwaysValidSchema)(n,r))return;let a=t.name("valid");t.forIn("key",s,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},a),t.if((0,Wi.not)(a),()=>{e.error(!0),n.allErrors||t.break()})}),e.ok(a)}};mn.default=Lf});var hn=y(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var mr=Z(),ne=b(),Uf=ge(),pr=q(),Ff={message:"must NOT have additional properties",params:({params:e})=>(0,ne._)`{additionalProperty: ${e.additionalProperty}}`},Kf={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ff,code(e){let{gen:t,schema:r,parentSchema:s,data:n,errsCount:a,it:i}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:o,opts:u}=i;if(i.props=!0,u.removeAdditional!=="all"&&(0,pr.alwaysValidSchema)(i,r))return;let d=(0,mr.allSchemaProperties)(s.properties),c=(0,mr.allSchemaProperties)(s.patternProperties);l(),e.ok((0,ne._)`${a} === ${Uf.default.errors}`);function l(){t.forIn("key",n,_=>{!d.length&&!c.length?f(_):t.if(h(_),()=>f(_))})}function h(_){let g;if(d.length>8){let N=(0,pr.schemaRefOrVal)(i,s.properties,"properties");g=(0,mr.isOwnProperty)(t,N,_)}else d.length?g=(0,ne.or)(...d.map(N=>(0,ne._)`${_} === ${N}`)):g=ne.nil;return c.length&&(g=(0,ne.or)(g,...c.map(N=>(0,ne._)`${(0,mr.usePattern)(e,N)}.test(${_})`))),(0,ne.not)(g)}function p(_){t.code((0,ne._)`delete ${n}[${_}]`)}function f(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){p(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),o||t.break();return}if(typeof r=="object"&&!(0,pr.alwaysValidSchema)(i,r)){let g=t.name("valid");u.removeAdditional==="failing"?(m(_,g,!1),t.if((0,ne.not)(g),()=>{e.reset(),p(_)})):(m(_,g),o||t.if((0,ne.not)(g),()=>t.break()))}}function m(_,g,N){let T={keyword:"additionalProperties",dataProp:_,dataPropType:pr.Type.Str};N===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(T,g)}}};pn.default=Kf});var eo=y(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});var Gf=wt(),Xi=Z(),yn=q(),Qi=hn(),Hf={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:s,data:n,it:a}=e;a.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&Qi.default.code(new Gf.KeywordCxt(a,Qi.default,"additionalProperties"));let i=(0,Xi.allSchemaProperties)(r);for(let l of i)a.definedProperties.add(l);a.opts.unevaluated&&i.length&&a.props!==!0&&(a.props=yn.mergeEvaluated.props(t,(0,yn.toHash)(i),a.props));let o=i.filter(l=>!(0,yn.alwaysValidSchema)(a,r[l]));if(o.length===0)return;let u=t.name("valid");for(let l of o)d(l)?c(l):(t.if((0,Xi.propertyInData)(t,n,l,a.opts.ownProperties)),c(l),a.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(l),e.ok(u);function d(l){return a.opts.useDefaults&&!a.compositeRule&&r[l].default!==void 0}function c(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},u)}}};_n.default=Hf});var no=y(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});var to=Z(),hr=b(),ro=q(),so=q(),Yf={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:s,parentSchema:n,it:a}=e,{opts:i}=a,o=(0,to.allSchemaProperties)(r),u=o.filter(m=>(0,ro.alwaysValidSchema)(a,r[m]));if(o.length===0||u.length===o.length&&(!a.opts.unevaluated||a.props===!0))return;let d=i.strictSchema&&!i.allowMatchingProperties&&n.properties,c=t.name("valid");a.props!==!0&&!(a.props instanceof hr.Name)&&(a.props=(0,so.eval
Line truncated
|
||||
@@ -0,0 +1,84 @@
|
||||
// packages/block-editor/build-module/utils/fit-text-frontend.mjs
|
||||
import { store, getElement, getContext } from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-editor/build-module/utils/fit-text-utils.mjs
|
||||
function findOptimalFontSize(textElement, applyFontSize) {
|
||||
const alreadyHasScrollableHeight = textElement.scrollHeight > textElement.clientHeight;
|
||||
let minSize = 0;
|
||||
let maxSize = 2400;
|
||||
let bestSize = minSize;
|
||||
const computedStyle = window.getComputedStyle(textElement);
|
||||
let paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
||||
let paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(textElement);
|
||||
let referenceElement = textElement;
|
||||
const parentElement = textElement.parentElement;
|
||||
if (parentElement) {
|
||||
const parentElementComputedStyle = window.getComputedStyle(parentElement);
|
||||
if (parentElementComputedStyle?.display === "flex") {
|
||||
referenceElement = parentElement;
|
||||
paddingLeft += parseFloat(parentElementComputedStyle.paddingLeft) || 0;
|
||||
paddingRight += parseFloat(parentElementComputedStyle.paddingRight) || 0;
|
||||
}
|
||||
}
|
||||
let maxclientHeight = referenceElement.clientHeight;
|
||||
while (minSize <= maxSize) {
|
||||
const midSize = Math.floor((minSize + maxSize) / 2);
|
||||
applyFontSize(midSize);
|
||||
const rect = range.getBoundingClientRect();
|
||||
const textWidth = rect.width;
|
||||
const fitsWidth = textElement.scrollWidth <= referenceElement.clientWidth && textWidth <= referenceElement.clientWidth - paddingLeft - paddingRight;
|
||||
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= referenceElement.clientHeight || textElement.scrollHeight <= maxclientHeight;
|
||||
if (referenceElement.clientHeight > maxclientHeight) {
|
||||
maxclientHeight = referenceElement.clientHeight;
|
||||
}
|
||||
if (fitsWidth && fitsHeight) {
|
||||
bestSize = midSize;
|
||||
minSize = midSize + 1;
|
||||
} else {
|
||||
maxSize = midSize - 1;
|
||||
}
|
||||
}
|
||||
range.detach();
|
||||
return bestSize;
|
||||
}
|
||||
function optimizeFitText(textElement, applyFontSize) {
|
||||
if (!textElement) {
|
||||
return;
|
||||
}
|
||||
applyFontSize(0);
|
||||
const optimalSize = findOptimalFontSize(textElement, applyFontSize);
|
||||
applyFontSize(optimalSize);
|
||||
return optimalSize;
|
||||
}
|
||||
|
||||
// packages/block-editor/build-module/utils/fit-text-frontend.mjs
|
||||
store("core/fit-text", {
|
||||
callbacks: {
|
||||
init() {
|
||||
const context = getContext();
|
||||
const { ref } = getElement();
|
||||
const applyFontSize = (fontSize) => {
|
||||
if (fontSize === 0) {
|
||||
ref.style.fontSize = "";
|
||||
} else {
|
||||
ref.style.fontSize = `${fontSize}px`;
|
||||
}
|
||||
};
|
||||
context.fontSize = optimizeFitText(ref, applyFontSize);
|
||||
if (window.ResizeObserver && ref.parentElement) {
|
||||
const resizeObserver = new window.ResizeObserver(() => {
|
||||
context.fontSize = optimizeFitText(ref, applyFontSize);
|
||||
});
|
||||
resizeObserver.observe(ref.parentElement);
|
||||
resizeObserver.observe(ref);
|
||||
return () => {
|
||||
if (resizeObserver) {
|
||||
resizeObserver.disconnect();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '383c7a8bd24a1f2fd9b9');
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{store as H,getElement as w,getContext as b}from"@wordpress/interactivity";function u(e,t){let o=e.scrollHeight>e.clientHeight,i=0,l=2400,g=i,f=window.getComputedStyle(e),p=parseFloat(f.paddingLeft)||0,h=parseFloat(f.paddingRight)||0,c=document.createRange();c.selectNodeContents(e);let r=e,s=e.parentElement;if(s){let n=window.getComputedStyle(s);n?.display==="flex"&&(r=s,p+=parseFloat(n.paddingLeft)||0,h+=parseFloat(n.paddingRight)||0)}let d=r.clientHeight;for(;i<=l;){let n=Math.floor((i+l)/2);t(n);let m=c.getBoundingClientRect().width,z=e.scrollWidth<=r.clientWidth&&m<=r.clientWidth-p-h,S=o||e.scrollHeight<=r.clientHeight||e.scrollHeight<=d;r.clientHeight>d&&(d=r.clientHeight),z&&S?(g=n,i=n+1):l=n-1}return c.detach(),g}function a(e,t){if(!e)return;t(0);let o=u(e,t);return t(o),o}H("core/fit-text",{callbacks:{init(){let e=b(),{ref:t}=w(),o=i=>{i===0?t.style.fontSize="":t.style.fontSize=`${i}px`};if(e.fontSize=a(t,o),window.ResizeObserver&&t.parentElement){let i=new window.ResizeObserver(()=>{e.fontSize=a(t,o)});return i.observe(t.parentElement),i.observe(t),()=>{i&&i.disconnect()}}}}});
|
||||
@@ -0,0 +1,119 @@
|
||||
// packages/block-library/build-module/accordion/view.mjs
|
||||
import { store, getContext, withSyncEvent } from "@wordpress/interactivity";
|
||||
var hashHandled = false;
|
||||
var { actions } = store(
|
||||
"core/accordion",
|
||||
{
|
||||
state: {
|
||||
get isOpen() {
|
||||
const { id, accordionItems } = getContext();
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
return accordionItem ? accordionItem.isOpen : false;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
toggle: () => {
|
||||
const context = getContext();
|
||||
const { id, autoclose, accordionItems } = context;
|
||||
const accordionItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
if (autoclose) {
|
||||
accordionItems.forEach((item) => {
|
||||
item.isOpen = item.id === id ? !accordionItem.isOpen : false;
|
||||
});
|
||||
} else {
|
||||
accordionItem.isOpen = !accordionItem.isOpen;
|
||||
}
|
||||
},
|
||||
handleKeyDown: withSyncEvent((event) => {
|
||||
if (event.key !== "ArrowUp" && event.key !== "ArrowDown" && event.key !== "Home" && event.key !== "End") {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
const context = getContext();
|
||||
const { id, accordionItems } = context;
|
||||
const currentIndex = accordionItems.findIndex(
|
||||
(item) => item.id === id
|
||||
);
|
||||
let nextIndex;
|
||||
switch (event.key) {
|
||||
case "ArrowUp":
|
||||
nextIndex = Math.max(0, currentIndex - 1);
|
||||
break;
|
||||
case "ArrowDown":
|
||||
nextIndex = Math.min(
|
||||
currentIndex + 1,
|
||||
accordionItems.length - 1
|
||||
);
|
||||
break;
|
||||
case "Home":
|
||||
nextIndex = 0;
|
||||
break;
|
||||
case "End":
|
||||
nextIndex = accordionItems.length - 1;
|
||||
break;
|
||||
}
|
||||
const nextId = accordionItems[nextIndex].id;
|
||||
const nextButton = document.getElementById(nextId);
|
||||
if (nextButton) {
|
||||
nextButton.focus();
|
||||
}
|
||||
}),
|
||||
openPanelByHash: () => {
|
||||
if (hashHandled || !window.location?.hash?.length) {
|
||||
return;
|
||||
}
|
||||
const context = getContext();
|
||||
const { id, accordionItems, autoclose } = context;
|
||||
const hash = decodeURIComponent(
|
||||
window.location.hash.slice(1)
|
||||
);
|
||||
const targetElement = window.document.getElementById(hash);
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
const panelElement = window.document.querySelector(
|
||||
'.wp-block-accordion-panel[aria-labelledby="' + id + '"]'
|
||||
);
|
||||
if (!panelElement || !panelElement.contains(targetElement)) {
|
||||
return;
|
||||
}
|
||||
hashHandled = true;
|
||||
if (autoclose) {
|
||||
accordionItems.forEach((item) => {
|
||||
item.isOpen = item.id === id;
|
||||
});
|
||||
} else {
|
||||
const targetItem = accordionItems.find(
|
||||
(item) => item.id === id
|
||||
);
|
||||
if (targetItem) {
|
||||
targetItem.isOpen = true;
|
||||
}
|
||||
}
|
||||
window.setTimeout(() => {
|
||||
targetElement.scrollIntoView();
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
initAccordionItems: () => {
|
||||
const context = getContext();
|
||||
const { id, openByDefault, accordionItems } = context;
|
||||
accordionItems.push({
|
||||
id,
|
||||
isOpen: openByDefault
|
||||
});
|
||||
actions.openPanelByHash();
|
||||
},
|
||||
hashChange: () => {
|
||||
hashHandled = false;
|
||||
actions.openPanelByHash();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '2af01b43d30739c3fb8d');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as f,getContext as i,withSyncEvent as m}from"@wordpress/interactivity";var l=!1,{actions:h}=f("core/accordion",{state:{get isOpen(){let{id:e,accordionItems:t}=i(),c=t.find(o=>o.id===e);return c?c.isOpen:!1}},actions:{toggle:()=>{let e=i(),{id:t,autoclose:c,accordionItems:o}=e,s=o.find(n=>n.id===t);c?o.forEach(n=>{n.isOpen=n.id===t?!s.isOpen:!1}):s.isOpen=!s.isOpen},handleKeyDown:m(e=>{if(e.key!=="ArrowUp"&&e.key!=="ArrowDown"&&e.key!=="Home"&&e.key!=="End")return;e.preventDefault();let t=i(),{id:c,accordionItems:o}=t,s=o.findIndex(d=>d.id===c),n;switch(e.key){case"ArrowUp":n=Math.max(0,s-1);break;case"ArrowDown":n=Math.min(s+1,o.length-1);break;case"Home":n=0;break;case"End":n=o.length-1;break}let r=o[n].id,a=document.getElementById(r);a&&a.focus()}),openPanelByHash:()=>{if(l||!window.location?.hash?.length)return;let e=i(),{id:t,accordionItems:c,autoclose:o}=e,s=decodeURIComponent(window.location.hash.slice(1)),n=window.document.getElementById(s);if(!n)return;let r=window.document.querySelector('.wp-block-accordion-panel[aria-labelledby="'+t+'"]');if(!(!r||!r.contains(n))){if(l=!0,o)c.forEach(a=>{a.isOpen=a.id===t});else{let a=c.find(d=>d.id===t);a&&(a.isOpen=!0)}window.setTimeout(()=>{n.scrollIntoView()},0)}}},callbacks:{initAccordionItems:()=>{let e=i(),{id:t,openByDefault:c,accordionItems:o}=e;o.push({id:t,isOpen:c}),h.openPanelByHash()},hashChange:()=>{l=!1,h.openPanelByHash()}}},{lock:!0});
|
||||
@@ -0,0 +1,44 @@
|
||||
// packages/block-library/build-module/file/view.mjs
|
||||
import { store } from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-library/build-module/file/utils/index.mjs
|
||||
var browserSupportsPdfs = () => {
|
||||
if (window.navigator.pdfViewerEnabled) {
|
||||
return true;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Mobi") > -1) {
|
||||
return false;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Android") > -1) {
|
||||
return false;
|
||||
}
|
||||
if (window.navigator.userAgent.indexOf("Macintosh") > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) {
|
||||
return false;
|
||||
}
|
||||
if (!!(window.ActiveXObject || "ActiveXObject" in window) && !(createActiveXObject("AcroPDF.PDF") || createActiveXObject("PDF.PdfCtrl"))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var createActiveXObject = (type) => {
|
||||
let ax;
|
||||
try {
|
||||
ax = new window.ActiveXObject(type);
|
||||
} catch (e) {
|
||||
ax = void 0;
|
||||
}
|
||||
return ax;
|
||||
};
|
||||
|
||||
// packages/block-library/build-module/file/view.mjs
|
||||
store(
|
||||
"core/file",
|
||||
{
|
||||
state: {
|
||||
get hasPdfPreview() {
|
||||
return browserSupportsPdfs();
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '7d4d261d10dca47ebecb');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as n}from"@wordpress/interactivity";var t=()=>window.navigator.pdfViewerEnabled?!0:!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!(r("AcroPDF.PDF")||r("PDF.PdfCtrl"))),r=i=>{let e;try{e=new window.ActiveXObject(i)}catch{e=void 0}return e};n("core/file",{state:{get hasPdfPreview(){return t()}}},{lock:!0});
|
||||
@@ -0,0 +1,45 @@
|
||||
// packages/block-library/build-module/form/view.mjs
|
||||
var formSettings;
|
||||
try {
|
||||
formSettings = JSON.parse(
|
||||
document.getElementById(
|
||||
"wp-script-module-data-@wordpress/block-library/form/view"
|
||||
)?.textContent
|
||||
);
|
||||
} catch {
|
||||
}
|
||||
document.querySelectorAll("form.wp-block-form").forEach(function(form) {
|
||||
if (!formSettings || !form.action || !form.action.startsWith("mailto:")) {
|
||||
return;
|
||||
}
|
||||
const redirectNotification = (status) => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
urlParams.append("wp-form-result", status);
|
||||
window.location.search = urlParams.toString();
|
||||
};
|
||||
form.addEventListener("submit", async function(event) {
|
||||
event.preventDefault();
|
||||
const formData = Object.fromEntries(new FormData(form).entries());
|
||||
formData.formAction = form.action;
|
||||
formData._ajax_nonce = formSettings.nonce;
|
||||
formData.action = formSettings.action;
|
||||
formData._wp_http_referer = window.location.href;
|
||||
formData.formAction = form.action;
|
||||
try {
|
||||
const response = await fetch(formSettings.ajaxUrl, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
body: new URLSearchParams(formData).toString()
|
||||
});
|
||||
if (response.ok) {
|
||||
redirectNotification("success");
|
||||
} else {
|
||||
redirectNotification("error");
|
||||
}
|
||||
} catch (error) {
|
||||
redirectNotification("error");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '5542f8ad251fe43ef09e');
|
||||
@@ -0,0 +1 @@
|
||||
var o;try{o=JSON.parse(document.getElementById("wp-script-module-data-@wordpress/block-library/form/view")?.textContent)}catch{}document.querySelectorAll("form.wp-block-form").forEach(function(e){if(!o||!e.action||!e.action.startsWith("mailto:"))return;let r=n=>{let t=new URLSearchParams(window.location.search);t.append("wp-form-result",n),window.location.search=t.toString()};e.addEventListener("submit",async function(n){n.preventDefault();let t=Object.fromEntries(new FormData(e).entries());t.formAction=e.action,t._ajax_nonce=o.nonce,t.action=o.action,t._wp_http_referer=window.location.href,t.formAction=e.action;try{(await fetch(o.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(t).toString()})).ok?r("success"):r("error")}catch{r("error")}})});
|
||||
@@ -0,0 +1,462 @@
|
||||
// packages/block-library/build-module/image/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
getConfig,
|
||||
withSyncEvent,
|
||||
withScope
|
||||
} from "@wordpress/interactivity";
|
||||
|
||||
// packages/block-library/build-module/image/constants.mjs
|
||||
var IMAGE_PRELOAD_DELAY = 200;
|
||||
|
||||
// packages/block-library/build-module/image/view.mjs
|
||||
var isTouching = false;
|
||||
var lastTouchTime = 0;
|
||||
var touchStartEvent = {
|
||||
startX: 0,
|
||||
startY: 0,
|
||||
startTime: 0
|
||||
};
|
||||
var focusableSelectors = [
|
||||
".wp-lightbox-close-button",
|
||||
".wp-lightbox-navigation-button"
|
||||
];
|
||||
function getImageSrc({ uploadedSrc }) {
|
||||
return uploadedSrc || "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
|
||||
}
|
||||
function getImageSrcset({ lightboxSrcset }) {
|
||||
return lightboxSrcset || "";
|
||||
}
|
||||
var { state, actions, callbacks } = store(
|
||||
"core/image",
|
||||
{
|
||||
state: {
|
||||
selectedImageId: null,
|
||||
selectedGalleryId: null,
|
||||
preloadTimers: /* @__PURE__ */ new Map(),
|
||||
preloadedImageIds: /* @__PURE__ */ new Set(),
|
||||
get galleryImages() {
|
||||
if (!state.selectedGalleryId) {
|
||||
return [state.selectedImageId];
|
||||
}
|
||||
return Object.entries(state.metadata).filter(
|
||||
([, value]) => value.galleryId === state.selectedGalleryId
|
||||
).sort(([, a], [, b]) => {
|
||||
const orderA = a.order ?? 0;
|
||||
const orderB = b.order ?? 0;
|
||||
return orderA - orderB;
|
||||
}).map(([key]) => key);
|
||||
},
|
||||
get selectedImageIndex() {
|
||||
return state.galleryImages.findIndex(
|
||||
(id) => id === state.selectedImageId
|
||||
);
|
||||
},
|
||||
get selectedImage() {
|
||||
return state.metadata[state.selectedImageId];
|
||||
},
|
||||
get hasNavigationIcon() {
|
||||
const { navigationButtonType } = state.selectedImage;
|
||||
return navigationButtonType === "icon" || navigationButtonType === "both";
|
||||
},
|
||||
get hasNavigationText() {
|
||||
const { navigationButtonType } = state.selectedImage;
|
||||
return navigationButtonType === "text" || navigationButtonType === "both";
|
||||
},
|
||||
get thisImage() {
|
||||
const { imageId } = getContext();
|
||||
return state.metadata[imageId];
|
||||
},
|
||||
get hasNavigation() {
|
||||
return state.galleryImages.length > 1;
|
||||
},
|
||||
get hasNextImage() {
|
||||
return state.selectedImageIndex + 1 < state.galleryImages.length;
|
||||
},
|
||||
get hasPreviousImage() {
|
||||
return state.selectedImageIndex - 1 >= 0;
|
||||
},
|
||||
get overlayOpened() {
|
||||
return state.selectedImageId !== null;
|
||||
},
|
||||
get roleAttribute() {
|
||||
return state.overlayOpened ? "dialog" : null;
|
||||
},
|
||||
get ariaModal() {
|
||||
return state.overlayOpened ? "true" : null;
|
||||
},
|
||||
get ariaLabel() {
|
||||
return state.selectedImage.customAriaLabel || getConfig().defaultAriaLabel;
|
||||
},
|
||||
get closeButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().closeButtonText;
|
||||
},
|
||||
get prevButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().prevButtonText;
|
||||
},
|
||||
get nextButtonAriaLabel() {
|
||||
return state.hasNavigationText ? void 0 : getConfig().nextButtonText;
|
||||
},
|
||||
get enlargedSrc() {
|
||||
return getImageSrc(state.selectedImage);
|
||||
},
|
||||
get enlargedSrcset() {
|
||||
return getImageSrcset(state.selectedImage);
|
||||
},
|
||||
get figureStyles() {
|
||||
return state.overlayOpened && `${state.selectedImage.figureStyles?.replace(
|
||||
/margin[^;]*;?/g,
|
||||
""
|
||||
)};`;
|
||||
},
|
||||
get imgStyles() {
|
||||
return state.overlayOpened && `${state.selectedImage.imgStyles?.replace(
|
||||
/;$/,
|
||||
""
|
||||
)}; object-fit:cover;`;
|
||||
},
|
||||
get isContentHidden() {
|
||||
const ctx = getContext();
|
||||
return state.overlayEnabled && state.selectedImageId === ctx.imageId;
|
||||
},
|
||||
get isContentVisible() {
|
||||
const ctx = getContext();
|
||||
return !state.overlayEnabled && state.selectedImageId === ctx.imageId;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
showLightbox() {
|
||||
const { imageId } = getContext();
|
||||
if (!state.metadata[imageId].imageRef?.complete) {
|
||||
return;
|
||||
}
|
||||
state.scrollTopReset = document.documentElement.scrollTop;
|
||||
state.scrollLeftReset = document.documentElement.scrollLeft;
|
||||
state.selectedImageId = imageId;
|
||||
const { galleryId } = getContext("core/gallery") || {};
|
||||
state.selectedGalleryId = galleryId || null;
|
||||
state.overlayEnabled = true;
|
||||
callbacks.setOverlayStyles();
|
||||
},
|
||||
hideLightbox() {
|
||||
if (state.overlayEnabled) {
|
||||
state.overlayEnabled = false;
|
||||
setTimeout(function() {
|
||||
state.selectedImage.buttonRef.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
state.selectedImageId = null;
|
||||
state.selectedGalleryId = null;
|
||||
}, 450);
|
||||
}
|
||||
},
|
||||
showPreviousImage: withSyncEvent((event) => {
|
||||
event.stopPropagation();
|
||||
const nextIndex = state.hasPreviousImage ? state.selectedImageIndex - 1 : state.galleryImages.length - 1;
|
||||
state.selectedImageId = state.galleryImages[nextIndex];
|
||||
callbacks.setOverlayStyles();
|
||||
}),
|
||||
showNextImage: withSyncEvent((event) => {
|
||||
event.stopPropagation();
|
||||
const nextIndex = state.hasNextImage ? state.selectedImageIndex + 1 : 0;
|
||||
state.selectedImageId = state.galleryImages[nextIndex];
|
||||
callbacks.setOverlayStyles();
|
||||
}),
|
||||
handleKeydown: withSyncEvent((event) => {
|
||||
if (state.overlayEnabled) {
|
||||
if (event.key === "Escape") {
|
||||
actions.hideLightbox();
|
||||
} else if (event.key === "ArrowLeft") {
|
||||
actions.showPreviousImage(event);
|
||||
} else if (event.key === "ArrowRight") {
|
||||
actions.showNextImage(event);
|
||||
} else if (event.key === "Tab") {
|
||||
const focusableElements = Array.from(
|
||||
document.querySelectorAll(focusableSelectors)
|
||||
);
|
||||
const firstFocusableElement = focusableElements[0];
|
||||
const lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
if (event.shiftKey && event.target === firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && event.target === lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
handleTouchMove: withSyncEvent((event) => {
|
||||
if (state.overlayEnabled) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}),
|
||||
handleTouchStart(event) {
|
||||
isTouching = true;
|
||||
const t = event.touches && event.touches[0];
|
||||
if (t) {
|
||||
touchStartEvent.startX = t.clientX;
|
||||
touchStartEvent.startY = t.clientY;
|
||||
touchStartEvent.startTime = Date.now();
|
||||
}
|
||||
},
|
||||
handleTouchEnd: withSyncEvent((event) => {
|
||||
const touchEndEvent = event.changedTouches && event.changedTouches[0] || event.touches && event.touches[0];
|
||||
const now = Date.now();
|
||||
if (touchEndEvent && state.overlayEnabled) {
|
||||
const deltaX = touchEndEvent.clientX - touchStartEvent.startX;
|
||||
const deltaY = touchEndEvent.clientY - touchStartEvent.startY;
|
||||
const absDeltaX = Math.abs(deltaX);
|
||||
const absDeltaY = Math.abs(deltaY);
|
||||
const elapsedMs = now - touchStartEvent.startTime;
|
||||
const isHorizontalSwipe = (
|
||||
// Swipe distance is greater than 50px
|
||||
absDeltaX > 50 && // Horizontal movement is much larger than the vertical movement
|
||||
absDeltaX > absDeltaY * 1.5 && // Fast action of less than 800ms
|
||||
elapsedMs < 800
|
||||
);
|
||||
if (isHorizontalSwipe) {
|
||||
event.preventDefault();
|
||||
if (deltaX < 0) {
|
||||
actions.showNextImage(event);
|
||||
} else {
|
||||
actions.showPreviousImage(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
lastTouchTime = now;
|
||||
isTouching = false;
|
||||
}),
|
||||
handleScroll() {
|
||||
if (state.overlayOpened) {
|
||||
if (!isTouching && Date.now() - lastTouchTime > 450) {
|
||||
window.scrollTo(
|
||||
state.scrollLeftReset,
|
||||
state.scrollTopReset
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
preloadImage() {
|
||||
const { imageId } = getContext();
|
||||
if (state.preloadedImageIds.has(imageId)) {
|
||||
return;
|
||||
}
|
||||
const imageMetadata = state.metadata[imageId];
|
||||
const imageLink = document.createElement("link");
|
||||
imageLink.rel = "preload";
|
||||
imageLink.as = "image";
|
||||
imageLink.href = getImageSrc(imageMetadata);
|
||||
const srcset = getImageSrcset(imageMetadata);
|
||||
if (srcset) {
|
||||
imageLink.setAttribute("imagesrcset", srcset);
|
||||
imageLink.setAttribute("imagesizes", "100vw");
|
||||
}
|
||||
document.head.appendChild(imageLink);
|
||||
state.preloadedImageIds.add(imageId);
|
||||
},
|
||||
preloadImageWithDelay() {
|
||||
const { imageId } = getContext();
|
||||
actions.cancelPreload();
|
||||
const timerId = setTimeout(
|
||||
withScope(() => {
|
||||
actions.preloadImage();
|
||||
state.preloadTimers.delete(imageId);
|
||||
}),
|
||||
IMAGE_PRELOAD_DELAY
|
||||
);
|
||||
state.preloadTimers.set(imageId, timerId);
|
||||
},
|
||||
cancelPreload() {
|
||||
const { imageId } = getContext();
|
||||
if (state.preloadTimers.has(imageId)) {
|
||||
clearTimeout(state.preloadTimers.get(imageId));
|
||||
state.preloadTimers.delete(imageId);
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
setOverlayStyles() {
|
||||
if (!state.overlayEnabled) {
|
||||
return;
|
||||
}
|
||||
let {
|
||||
naturalWidth,
|
||||
naturalHeight,
|
||||
offsetWidth: originalWidth,
|
||||
offsetHeight: originalHeight
|
||||
} = state.selectedImage.imageRef;
|
||||
let { x: screenPosX, y: screenPosY } = state.selectedImage.imageRef.getBoundingClientRect();
|
||||
const naturalRatio = naturalWidth / naturalHeight;
|
||||
let originalRatio = originalWidth / originalHeight;
|
||||
if (state.selectedImage.scaleAttr === "contain") {
|
||||
if (naturalRatio > originalRatio) {
|
||||
const heightWithoutSpace = originalWidth / naturalRatio;
|
||||
screenPosY += (originalHeight - heightWithoutSpace) / 2;
|
||||
originalHeight = heightWithoutSpace;
|
||||
} else {
|
||||
const widthWithoutSpace = originalHeight * naturalRatio;
|
||||
screenPosX += (originalWidth - widthWithoutSpace) / 2;
|
||||
originalWidth = widthWithoutSpace;
|
||||
}
|
||||
}
|
||||
originalRatio = originalWidth / originalHeight;
|
||||
let imgMaxWidth = parseFloat(
|
||||
state.selectedImage.targetWidth && state.selectedImage.targetWidth !== "none" ? state.selectedImage.targetWidth : naturalWidth
|
||||
);
|
||||
let imgMaxHeight = parseFloat(
|
||||
state.selectedImage.targetHeight && state.selectedImage.targetHeight !== "none" ? state.selectedImage.targetHeight : naturalHeight
|
||||
);
|
||||
let imgRatio = imgMaxWidth / imgMaxHeight;
|
||||
let containerMaxWidth = imgMaxWidth;
|
||||
let containerMaxHeight = imgMaxHeight;
|
||||
let containerWidth = imgMaxWidth;
|
||||
let containerHeight = imgMaxHeight;
|
||||
if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) {
|
||||
if (naturalRatio > imgRatio) {
|
||||
const reducedHeight = imgMaxWidth / naturalRatio;
|
||||
if (imgMaxHeight - reducedHeight > imgMaxWidth) {
|
||||
imgMaxHeight = reducedHeight;
|
||||
imgMaxWidth = reducedHeight * naturalRatio;
|
||||
} else {
|
||||
imgMaxHeight = imgMaxWidth / naturalRatio;
|
||||
}
|
||||
} else {
|
||||
const reducedWidth = imgMaxHeight * naturalRatio;
|
||||
if (imgMaxWidth - reducedWidth > imgMaxHeight) {
|
||||
imgMaxWidth = reducedWidth;
|
||||
imgMaxHeight = reducedWidth / naturalRatio;
|
||||
} else {
|
||||
imgMaxWidth = imgMaxHeight * naturalRatio;
|
||||
}
|
||||
}
|
||||
containerWidth = imgMaxWidth;
|
||||
containerHeight = imgMaxHeight;
|
||||
imgRatio = imgMaxWidth / imgMaxHeight;
|
||||
if (originalRatio > imgRatio) {
|
||||
containerMaxWidth = imgMaxWidth;
|
||||
containerMaxHeight = containerMaxWidth / originalRatio;
|
||||
} else {
|
||||
containerMaxHeight = imgMaxHeight;
|
||||
containerMaxWidth = containerMaxHeight * originalRatio;
|
||||
}
|
||||
}
|
||||
if (originalWidth > containerWidth || originalHeight > containerHeight) {
|
||||
containerWidth = originalWidth;
|
||||
containerHeight = originalHeight;
|
||||
}
|
||||
let horizontalPadding = 0;
|
||||
let verticalPadding = 160;
|
||||
if (480 < window.innerWidth) {
|
||||
horizontalPadding = 80;
|
||||
verticalPadding = 160;
|
||||
}
|
||||
if (960 < window.innerWidth) {
|
||||
horizontalPadding = state.hasNavigation ? 320 : 80;
|
||||
verticalPadding = 80;
|
||||
}
|
||||
const targetMaxWidth = Math.min(
|
||||
window.innerWidth - horizontalPadding,
|
||||
containerWidth
|
||||
);
|
||||
const targetMaxHeight = Math.min(
|
||||
window.innerHeight - verticalPadding,
|
||||
containerHeight
|
||||
);
|
||||
const targetContainerRatio = targetMaxWidth / targetMaxHeight;
|
||||
if (originalRatio > targetContainerRatio) {
|
||||
containerWidth = targetMaxWidth;
|
||||
containerHeight = containerWidth / originalRatio;
|
||||
} else {
|
||||
containerHeight = targetMaxHeight;
|
||||
containerWidth = containerHeight * originalRatio;
|
||||
}
|
||||
const containerScale = originalWidth / containerWidth;
|
||||
const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth);
|
||||
const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight);
|
||||
state.overlayStyles = `
|
||||
--wp--lightbox-initial-top-position: ${screenPosY}px;
|
||||
--wp--lightbox-initial-left-position: ${screenPosX}px;
|
||||
--wp--lightbox-container-width: ${containerWidth + 1}px;
|
||||
--wp--lightbox-container-height: ${containerHeight + 1}px;
|
||||
--wp--lightbox-image-width: ${lightboxImgWidth}px;
|
||||
--wp--lightbox-image-height: ${lightboxImgHeight}px;
|
||||
--wp--lightbox-scale: ${containerScale};
|
||||
--wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px;
|
||||
`;
|
||||
},
|
||||
setButtonStyles() {
|
||||
const { ref } = getElement();
|
||||
if (!ref) {
|
||||
return;
|
||||
}
|
||||
const { imageId } = getContext();
|
||||
state.metadata[imageId].imageRef = ref;
|
||||
state.metadata[imageId].currentSrc = ref.currentSrc;
|
||||
const {
|
||||
naturalWidth,
|
||||
naturalHeight,
|
||||
offsetWidth,
|
||||
offsetHeight
|
||||
} = ref;
|
||||
if (naturalWidth === 0 || naturalHeight === 0) {
|
||||
return;
|
||||
}
|
||||
const figure = ref.parentElement;
|
||||
const figureWidth = ref.parentElement.clientWidth;
|
||||
let figureHeight = ref.parentElement.clientHeight;
|
||||
const caption = figure.querySelector("figcaption");
|
||||
if (caption) {
|
||||
const captionComputedStyle = window.getComputedStyle(caption);
|
||||
if (!["absolute", "fixed"].includes(
|
||||
captionComputedStyle.position
|
||||
)) {
|
||||
figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom);
|
||||
}
|
||||
}
|
||||
const buttonOffsetTop = figureHeight - offsetHeight;
|
||||
const buttonOffsetRight = figureWidth - offsetWidth;
|
||||
let buttonTop = buttonOffsetTop + 16;
|
||||
let buttonRight = buttonOffsetRight + 16;
|
||||
if (state.metadata[imageId].scaleAttr === "contain") {
|
||||
const naturalRatio = naturalWidth / naturalHeight;
|
||||
const offsetRatio = offsetWidth / offsetHeight;
|
||||
if (naturalRatio >= offsetRatio) {
|
||||
const referenceHeight = offsetWidth / naturalRatio;
|
||||
buttonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16;
|
||||
buttonRight = buttonOffsetRight + 16;
|
||||
} else {
|
||||
const referenceWidth = offsetHeight * naturalRatio;
|
||||
buttonTop = buttonOffsetTop + 16;
|
||||
buttonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16;
|
||||
}
|
||||
}
|
||||
state.metadata[imageId].buttonTop = buttonTop;
|
||||
state.metadata[imageId].buttonRight = buttonRight;
|
||||
},
|
||||
setOverlayFocus() {
|
||||
if (state.overlayEnabled) {
|
||||
const { ref } = getElement();
|
||||
ref.focus();
|
||||
}
|
||||
},
|
||||
setInertElements() {
|
||||
document.querySelectorAll("body > :not(.wp-lightbox-overlay)").forEach((el) => {
|
||||
if (state.overlayEnabled) {
|
||||
el.setAttribute("inert", "");
|
||||
} else {
|
||||
el.removeAttribute("inert");
|
||||
}
|
||||
});
|
||||
},
|
||||
initTriggerButton() {
|
||||
const { imageId } = getContext();
|
||||
const { ref } = getElement();
|
||||
state.metadata[imageId].buttonRef = ref;
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '25ee935fd6c67371d0f3');
|
||||
@@ -0,0 +1,10 @@
|
||||
import{store as P,getContext as u,getElement as v,getConfig as A,withSyncEvent as T,withScope as C}from"@wordpress/interactivity";var L=200;var w=!1,W=0,x={startX:0,startY:0,startTime:0},Y=[".wp-lightbox-close-button",".wp-lightbox-navigation-button"];function O({uploadedSrc:t}){return t||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}function R({lightboxSrcset:t}){return t||""}var{state:e,actions:y,callbacks:S}=P("core/image",{state:{selectedImageId:null,selectedGalleryId:null,preloadTimers:new Map,preloadedImageIds:new Set,get galleryImages(){return e.selectedGalleryId?Object.entries(e.metadata).filter(([,t])=>t.galleryId===e.selectedGalleryId).sort(([,t],[,a])=>{let o=t.order??0,l=a.order??0;return o-l}).map(([t])=>t):[e.selectedImageId]},get selectedImageIndex(){return e.galleryImages.findIndex(t=>t===e.selectedImageId)},get selectedImage(){return e.metadata[e.selectedImageId]},get hasNavigationIcon(){let{navigationButtonType:t}=e.selectedImage;return t==="icon"||t==="both"},get hasNavigationText(){let{navigationButtonType:t}=e.selectedImage;return t==="text"||t==="both"},get thisImage(){let{imageId:t}=u();return e.metadata[t]},get hasNavigation(){return e.galleryImages.length>1},get hasNextImage(){return e.selectedImageIndex+1<e.galleryImages.length},get hasPreviousImage(){return e.selectedImageIndex-1>=0},get overlayOpened(){return e.selectedImageId!==null},get roleAttribute(){return e.overlayOpened?"dialog":null},get ariaModal(){return e.overlayOpened?"true":null},get ariaLabel(){return e.selectedImage.customAriaLabel||A().defaultAriaLabel},get closeButtonAriaLabel(){return e.hasNavigationText?void 0:A().closeButtonText},get prevButtonAriaLabel(){return e.hasNavigationText?void 0:A().prevButtonText},get nextButtonAriaLabel(){return e.hasNavigationText?void 0:A().nextButtonText},get enlargedSrc(){return O(e.selectedImage)},get enlargedSrcset(){return R(e.selectedImage)},get figureStyles(){return e.overlayOpened&&`${e.selectedImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return e.overlayOpened&&`${e.selectedImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get isContentHidden(){let t=u();return e.overlayEnabled&&e.selectedImageId===t.imageId},get isContentVisible(){let t=u();return!e.overlayEnabled&&e.selectedImageId===t.imageId}},actions:{showLightbox(){let{imageId:t}=u();if(!e.metadata[t].imageRef?.complete)return;e.scrollTopReset=document.documentElement.scrollTop,e.scrollLeftReset=document.documentElement.scrollLeft,e.selectedImageId=t;let{galleryId:a}=u("core/gallery")||{};e.selectedGalleryId=a||null,e.overlayEnabled=!0,S.setOverlayStyles()},hideLightbox(){e.overlayEnabled&&(e.overlayEnabled=!1,setTimeout(function(){e.selectedImage.buttonRef.focus({preventScroll:!0}),e.selectedImageId=null,e.selectedGalleryId=null},450))},showPreviousImage:T(t=>{t.stopPropagation();let a=e.hasPreviousImage?e.selectedImageIndex-1:e.galleryImages.length-1;e.selectedImageId=e.galleryImages[a],S.setOverlayStyles()}),showNextImage:T(t=>{t.stopPropagation();let a=e.hasNextImage?e.selectedImageIndex+1:0;e.selectedImageId=e.galleryImages[a],S.setOverlayStyles()}),handleKeydown:T(t=>{if(e.overlayEnabled){if(t.key==="Escape")y.hideLightbox();else if(t.key==="ArrowLeft")y.showPreviousImage(t);else if(t.key==="ArrowRight")y.showNextImage(t);else if(t.key==="Tab"){let a=Array.from(document.querySelectorAll(Y)),o=a[0],l=a[a.length-1];t.shiftKey&&t.target===o?(t.preventDefault(),l.focus()):!t.shiftKey&&t.target===l&&(t.preventDefault(),o.focus())}}}),handleTouchMove:T(t=>{e.overlayEnabled&&t.preventDefault()}),handleTouchStart(t){w=!0;let a=t.touches&&t.touches[0];a&&(x.startX=a.clientX,x.startY=a.clientY,x.startTime=Date.now())},handleTouchEnd:T(t=>{let a=t.changedTouches&&t.changedTouches[0]||t.touches&&t.touches[0],o=Date.now();if(a&&e.overlayEnabled){let l=a.clientX-x.startX,h=a.clientY-x.startY,m=Math.abs(l),s=Math.abs(h),d=o-x.startTime;m>50&&m>s*1.5&&d<800&&(t.preventDefault(),l<0?y.showNextImage(t):y.showPreviousImage(t))}W=o,w=!1}),handleScroll(){e.overlayOpened&&!w&&Date.now()-W>450&&window.scrollTo(e.scrollLeftReset,e.scrollTopReset)},preloadImage(){let{imageId:t}=u();if(e.preloadedImageIds.has(t))return;let a=e.metadata[t],o=document.createElement("link");o.rel="preload",o.as="image",o.href=O(a);let l=R(a);l&&(o.setAttribute("imagesrcset",l),o.setAttribute("imagesizes","100vw")),document.head.appendChild(o),e.preloadedImageIds.add(t)},preloadImageWithDelay(){let{imageId:t}=u();y.cancelPreload();let a=setTimeout(C(()=>{y.preloadImage(),e.preloadTimers.delete(t)}),L);e.preloadTimers.set(t,a)},cancelPreload(){let{imageId:t}=u();e.preloadTimers.has(t)&&(clearTimeout(e.preloadTimers.get(t)),e.preloadTimers.delete(t))}},callbacks:{setOverlayStyles(){if(!e.overlayEnabled)return;let{naturalWidth:t,naturalHeight:a,offsetWidth:o,offsetHeight:l}=e.selectedImage.imageRef,{x:h,y:m}=e.selectedImage.imageRef.getBoundingClientRect(),s=t/a,d=o/l;if(e.selectedImage.scaleAttr==="contain")if(sLine truncated
|
||||
--wp--lightbox-initial-top-position: ${m}px;
|
||||
--wp--lightbox-initial-left-position: ${h}px;
|
||||
--wp--lightbox-container-width: ${c+1}px;
|
||||
--wp--lightbox-container-height: ${n+1}px;
|
||||
--wp--lightbox-image-width: ${H}px;
|
||||
--wp--lightbox-image-height: ${B}px;
|
||||
--wp--lightbox-scale: ${M};
|
||||
--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;
|
||||
`},setButtonStyles(){let{ref:t}=v();if(!t)return;let{imageId:a}=u();e.metadata[a].imageRef=t,e.metadata[a].currentSrc=t.currentSrc;let{naturalWidth:o,naturalHeight:l,offsetWidth:h,offsetHeight:m}=t;if(o===0||l===0)return;let s=t.parentElement,d=t.parentElement.clientWidth,r=t.parentElement.clientHeight,i=s.querySelector("figcaption");if(i){let n=window.getComputedStyle(i);["absolute","fixed"].includes(n.position)||(r=r-i.offsetHeight-parseFloat(n.marginTop)-parseFloat(n.marginBottom))}let I=r-m,f=d-h,p=I+16,c=f+16;if(e.metadata[a].scaleAttr==="contain"){let n=o/l,E=h/m;if(n>=E){let b=h/n;p=(m-b)/2+I+16,c=f+16}else{let b=m*n;p=I+16,c=(h-b)/2+f+16}}e.metadata[a].buttonTop=p,e.metadata[a].buttonRight=c},setOverlayFocus(){if(e.overlayEnabled){let{ref:t}=v();t.focus()}},setInertElements(){document.querySelectorAll("body > :not(.wp-lightbox-overlay)").forEach(t=>{e.overlayEnabled?t.setAttribute("inert",""):t.removeAttribute("inert")})},initTriggerButton(){let{imageId:t}=u(),{ref:a}=v();e.metadata[t].buttonRef=a}}},{lock:!0});
|
||||
@@ -0,0 +1,177 @@
|
||||
// packages/block-library/build-module/navigation/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var focusableSelectors = [
|
||||
"a[href]",
|
||||
'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
|
||||
"select:not([disabled]):not([aria-hidden])",
|
||||
"textarea:not([disabled]):not([aria-hidden])",
|
||||
"button:not([disabled]):not([aria-hidden])",
|
||||
"[contenteditable]",
|
||||
'[tabindex]:not([tabindex^="-"])'
|
||||
];
|
||||
function getFocusableElements(ref) {
|
||||
const focusableElements = ref.querySelectorAll(focusableSelectors);
|
||||
return Array.from(focusableElements).filter((element) => {
|
||||
if (typeof element.checkVisibility === "function") {
|
||||
return element.checkVisibility({
|
||||
checkOpacity: false,
|
||||
checkVisibilityCSS: true
|
||||
});
|
||||
}
|
||||
return element.offsetParent !== null;
|
||||
});
|
||||
}
|
||||
document.addEventListener("click", () => {
|
||||
});
|
||||
var { state, actions } = store(
|
||||
"core/navigation",
|
||||
{
|
||||
state: {
|
||||
get roleAttribute() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? "dialog" : null;
|
||||
},
|
||||
get ariaModal() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? "true" : null;
|
||||
},
|
||||
get ariaLabel() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" && state.isMenuOpen ? ctx.ariaLabel : null;
|
||||
},
|
||||
get isMenuOpen() {
|
||||
return Object.values(state.menuOpenedBy).filter(Boolean).length > 0;
|
||||
},
|
||||
get menuOpenedBy() {
|
||||
const ctx = getContext();
|
||||
return ctx.type === "overlay" ? ctx.overlayOpenedBy : ctx.submenuOpenedBy;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
openMenuOnHover(event) {
|
||||
if (event?.pointerType === "touch") {
|
||||
return;
|
||||
}
|
||||
const { type, overlayOpenedBy } = getContext();
|
||||
if (type === "submenu" && // Only open on hover if the overlay is closed.
|
||||
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
|
||||
actions.openMenu("hover");
|
||||
}
|
||||
},
|
||||
closeMenuOnHover(event) {
|
||||
if (event?.pointerType === "touch") {
|
||||
return;
|
||||
}
|
||||
const { type, overlayOpenedBy } = getContext();
|
||||
if (type === "submenu" && // Only close on hover if the overlay is closed.
|
||||
Object.values(overlayOpenedBy || {}).filter(Boolean).length === 0) {
|
||||
actions.closeMenu("hover");
|
||||
}
|
||||
},
|
||||
openMenuOnClick() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu("click");
|
||||
},
|
||||
closeMenuOnClick() {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
},
|
||||
openMenuOnFocus() {
|
||||
actions.openMenu("focus");
|
||||
},
|
||||
toggleMenuOnClick() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (window.document.activeElement !== ref) {
|
||||
ref.focus();
|
||||
}
|
||||
const { menuOpenedBy } = state;
|
||||
if (menuOpenedBy.click || menuOpenedBy.focus) {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
actions.closeMenu("hover");
|
||||
} else {
|
||||
ctx.previousFocus = ref;
|
||||
actions.openMenu("click");
|
||||
}
|
||||
},
|
||||
handleMenuKeydown: withSyncEvent((event) => {
|
||||
const { type, firstFocusableElement, lastFocusableElement } = getContext();
|
||||
if (state.menuOpenedBy.click) {
|
||||
if (event.key === "Escape") {
|
||||
event.stopPropagation();
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
return;
|
||||
}
|
||||
if (type === "overlay" && event.key === "Tab") {
|
||||
if (event.shiftKey && window.document.activeElement === firstFocusableElement) {
|
||||
event.preventDefault();
|
||||
lastFocusableElement.focus();
|
||||
} else if (!event.shiftKey && window.document.activeElement === lastFocusableElement) {
|
||||
event.preventDefault();
|
||||
firstFocusableElement.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
handleMenuFocusout: withSyncEvent((event) => {
|
||||
const { modal, type } = getContext();
|
||||
if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === "submenu") {
|
||||
actions.closeMenu("click");
|
||||
actions.closeMenu("focus");
|
||||
}
|
||||
}),
|
||||
openMenu(menuOpenedOn = "click") {
|
||||
const { type } = getContext();
|
||||
state.menuOpenedBy[menuOpenedOn] = true;
|
||||
if (type === "overlay") {
|
||||
document.documentElement.classList.add("has-modal-open");
|
||||
}
|
||||
},
|
||||
closeMenu(menuClosedOn = "click") {
|
||||
const ctx = getContext();
|
||||
state.menuOpenedBy[menuClosedOn] = false;
|
||||
if (!state.isMenuOpen) {
|
||||
if (ctx.modal?.contains(window.document.activeElement)) {
|
||||
ctx.previousFocus?.focus();
|
||||
}
|
||||
ctx.modal = null;
|
||||
ctx.previousFocus = null;
|
||||
if (ctx.type === "overlay") {
|
||||
document.documentElement.classList.remove(
|
||||
"has-modal-open"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
initMenu() {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = getFocusableElements(ref);
|
||||
ctx.modal = ref;
|
||||
ctx.firstFocusableElement = focusableElements[0];
|
||||
ctx.lastFocusableElement = focusableElements[focusableElements.length - 1];
|
||||
}
|
||||
},
|
||||
focusFirstElement() {
|
||||
const { ref } = getElement();
|
||||
if (state.isMenuOpen) {
|
||||
const focusableElements = getFocusableElements(ref);
|
||||
focusableElements?.[0]?.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '96a846e1d7b789c39ab9');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as r,getContext as c,getElement as s,withSyncEvent as i}from"@wordpress/interactivity";var d=["a[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];function a(e){let n=e.querySelectorAll(d);return Array.from(n).filter(t=>typeof t.checkVisibility=="function"?t.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0}):t.offsetParent!==null)}document.addEventListener("click",()=>{});var{state:l,actions:o}=r("core/navigation",{state:{get roleAttribute(){return c().type==="overlay"&&l.isMenuOpen?"dialog":null},get ariaModal(){return c().type==="overlay"&&l.isMenuOpen?"true":null},get ariaLabel(){let e=c();return e.type==="overlay"&&l.isMenuOpen?e.ariaLabel:null},get isMenuOpen(){return Object.values(l.menuOpenedBy).filter(Boolean).length>0},get menuOpenedBy(){let e=c();return e.type==="overlay"?e.overlayOpenedBy:e.submenuOpenedBy}},actions:{openMenuOnHover(e){if(e?.pointerType==="touch")return;let{type:n,overlayOpenedBy:t}=c();n==="submenu"&&Object.values(t||{}).filter(Boolean).length===0&&o.openMenu("hover")},closeMenuOnHover(e){if(e?.pointerType==="touch")return;let{type:n,overlayOpenedBy:t}=c();n==="submenu"&&Object.values(t||{}).filter(Boolean).length===0&&o.closeMenu("hover")},openMenuOnClick(){let e=c(),{ref:n}=s();e.previousFocus=n,o.openMenu("click")},closeMenuOnClick(){o.closeMenu("click"),o.closeMenu("focus")},openMenuOnFocus(){o.openMenu("focus")},toggleMenuOnClick(){let e=c(),{ref:n}=s();window.document.activeElement!==n&&n.focus();let{menuOpenedBy:t}=l;t.click||t.focus?(o.closeMenu("click"),o.closeMenu("focus"),o.closeMenu("hover")):(e.previousFocus=n,o.openMenu("click"))},handleMenuKeydown:i(e=>{let{type:n,firstFocusableElement:t,lastFocusableElement:u}=c();if(l.menuOpenedBy.click){if(e.key==="Escape"){e.stopPropagation(),o.closeMenu("click"),o.closeMenu("focus");return}n==="overlay"&&e.key==="Tab"&&(e.shiftKey&&window.document.activeElement===t?(e.preventDefault(),u.focus()):!e.shiftKey&&window.document.activeElement===u&&(e.preventDefault(),t.focus()))}}),handleMenuFocusout:i(e=>{let{modal:n,type:t}=c();(e.relatedTarget===null||!n?.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&t==="submenu")&&(o.closeMenu("click"),o.closeMenu("focus"))}),openMenu(e="click"){let{type:n}=c();l.menuOpenedBy[e]=!0,n==="overlay"&&document.documentElement.classList.add("has-modal-open")},closeMenu(e="click"){let n=c();l.menuOpenedBy[e]=!1,l.isMenuOpen||(n.modal?.contains(window.document.activeElement)&&n.previousFocus?.focus(),n.modal=null,n.previousFocus=null,n.type==="overlay"&&document.documentElement.classList.remove("has-modal-open"))}},callbacks:{initMenu(){let e=c(),{ref:n}=s();if(l.isMenuOpen){let t=a(n);e.modal=n,e.firstFocusableElement=t[0],e.lastFocusableElement=t[t.length-1]}},focusFirstElement(){let{ref:e}=s();l.isMenuOpen&&a(e)?.[0]?.focus()}}},{lock:!0});
|
||||
@@ -0,0 +1,64 @@
|
||||
// packages/block-library/build-module/playlist/view.mjs
|
||||
import { store, getContext, getElement } from "@wordpress/interactivity";
|
||||
store(
|
||||
"core/playlist",
|
||||
{
|
||||
state: {
|
||||
playlists: {},
|
||||
get currentTrack() {
|
||||
const { currentId, playlistId } = getContext();
|
||||
if (!currentId || !playlistId) {
|
||||
return {};
|
||||
}
|
||||
const playlist = this.playlists[playlistId];
|
||||
if (!playlist) {
|
||||
return {};
|
||||
}
|
||||
return playlist.tracks[currentId] || {};
|
||||
},
|
||||
get isCurrentTrack() {
|
||||
const { currentId, uniqueId } = getContext();
|
||||
return currentId === uniqueId;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
changeTrack() {
|
||||
const context = getContext();
|
||||
context.currentId = context.uniqueId;
|
||||
context.isPlaying = true;
|
||||
},
|
||||
isPlaying() {
|
||||
const context = getContext();
|
||||
context.isPlaying = true;
|
||||
},
|
||||
isPaused() {
|
||||
const context = getContext();
|
||||
context.isPlaying = false;
|
||||
},
|
||||
nextSong() {
|
||||
const context = getContext();
|
||||
const currentIndex = context.tracks.findIndex(
|
||||
(uniqueId) => uniqueId === context.currentId
|
||||
);
|
||||
const nextTrack = context.tracks[currentIndex + 1];
|
||||
if (nextTrack) {
|
||||
context.currentId = nextTrack;
|
||||
const { ref } = getElement();
|
||||
setTimeout(() => {
|
||||
ref.play();
|
||||
}, 1e3);
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
autoPlay() {
|
||||
const context = getContext();
|
||||
const { ref } = getElement();
|
||||
if (context.currentId && context.isPlaying) {
|
||||
ref.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '99f747d731f80246db11');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as a,getContext as e,getElement as s}from"@wordpress/interactivity";a("core/playlist",{state:{playlists:{},get currentTrack(){let{currentId:t,playlistId:n}=e();if(!t||!n)return{};let r=this.playlists[n];return r?r.tracks[t]||{}:{}},get isCurrentTrack(){let{currentId:t,uniqueId:n}=e();return t===n}},actions:{changeTrack(){let t=e();t.currentId=t.uniqueId,t.isPlaying=!0},isPlaying(){let t=e();t.isPlaying=!0},isPaused(){let t=e();t.isPlaying=!1},nextSong(){let t=e(),n=t.tracks.findIndex(c=>c===t.currentId),r=t.tracks[n+1];if(r){t.currentId=r;let{ref:c}=s();setTimeout(()=>{c.play()},1e3)}}},callbacks:{autoPlay(){let t=e(),{ref:n}=s();t.currentId&&t.isPlaying&&n.play()}}},{lock:!0});
|
||||
@@ -0,0 +1,53 @@
|
||||
// packages/block-library/build-module/query/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var isValidLink = (ref) => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === "_self") && ref.origin === window.location.origin;
|
||||
var isValidEvent = (event) => event.button === 0 && // Left clicks only.
|
||||
!event.metaKey && // Open in new tab (Mac).
|
||||
!event.ctrlKey && // Open in new tab (Windows).
|
||||
!event.altKey && // Download.
|
||||
!event.shiftKey && !event.defaultPrevented;
|
||||
store(
|
||||
"core/query",
|
||||
{
|
||||
actions: {
|
||||
navigate: withSyncEvent(function* (event) {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
const queryRef = ref.closest(
|
||||
".wp-block-query[data-wp-router-region]"
|
||||
);
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
event.preventDefault();
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.navigate(ref.href);
|
||||
ctx.url = ref.href;
|
||||
const firstAnchor = `.wp-block-post-template a[href]`;
|
||||
queryRef.querySelector(firstAnchor)?.focus();
|
||||
}
|
||||
}),
|
||||
*prefetch() {
|
||||
const { ref } = getElement();
|
||||
if (isValidLink(ref)) {
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
*prefetch() {
|
||||
const { url } = getContext();
|
||||
const { ref } = getElement();
|
||||
if (url && isValidLink(ref)) {
|
||||
const { actions } = yield import("@wordpress/interactivity-router");
|
||||
yield actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static'), array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '7a4ec5bfb61a7137cf4b');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as a,getContext as c,getElement as r,withSyncEvent as l}from"@wordpress/interactivity";var i=t=>t&&t instanceof window.HTMLAnchorElement&&t.href&&(!t.target||t.target==="_self")&&t.origin===window.location.origin,f=t=>t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.defaultPrevented;a("core/query",{actions:{navigate:l(function*(t){let e=c(),{ref:o}=r(),n=o.closest(".wp-block-query[data-wp-router-region]");if(i(o)&&f(t)){t.preventDefault();let{actions:s}=yield import("@wordpress/interactivity-router");yield s.navigate(o.href),e.url=o.href,n.querySelector(".wp-block-post-template a[href]")?.focus()}}),*prefetch(){let{ref:t}=r();if(i(t)){let{actions:e}=yield import("@wordpress/interactivity-router");yield e.prefetch(t.href)}}},callbacks:{*prefetch(){let{url:t}=c(),{ref:e}=r();if(t&&i(e)){let{actions:o}=yield import("@wordpress/interactivity-router");yield o.prefetch(e.href)}}}},{lock:!0});
|
||||
@@ -0,0 +1,63 @@
|
||||
// packages/block-library/build-module/search/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
var { actions } = store(
|
||||
"core/search",
|
||||
{
|
||||
state: {
|
||||
get ariaLabel() {
|
||||
const {
|
||||
isSearchInputVisible,
|
||||
ariaLabelCollapsed,
|
||||
ariaLabelExpanded
|
||||
} = getContext();
|
||||
return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed;
|
||||
},
|
||||
get ariaControls() {
|
||||
const { isSearchInputVisible, inputId } = getContext();
|
||||
return isSearchInputVisible ? null : inputId;
|
||||
},
|
||||
get type() {
|
||||
const { isSearchInputVisible } = getContext();
|
||||
return isSearchInputVisible ? "submit" : "button";
|
||||
},
|
||||
get tabindex() {
|
||||
const { isSearchInputVisible } = getContext();
|
||||
return isSearchInputVisible ? "0" : "-1";
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
openSearchInput: withSyncEvent((event) => {
|
||||
const ctx = getContext();
|
||||
const { ref } = getElement();
|
||||
if (!ctx.isSearchInputVisible) {
|
||||
event.preventDefault();
|
||||
ctx.isSearchInputVisible = true;
|
||||
ref.parentElement.querySelector("input").focus();
|
||||
}
|
||||
}),
|
||||
closeSearchInput() {
|
||||
const ctx = getContext();
|
||||
ctx.isSearchInputVisible = false;
|
||||
},
|
||||
handleSearchKeydown: withSyncEvent((event) => {
|
||||
const { ref } = getElement();
|
||||
if (event?.key === "Escape") {
|
||||
actions.closeSearchInput();
|
||||
ref.querySelector("button").focus();
|
||||
}
|
||||
}),
|
||||
handleSearchFocusout: withSyncEvent((event) => {
|
||||
const { ref } = getElement();
|
||||
if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) {
|
||||
actions.closeSearchInput();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
{ lock: true }
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '38bd0e230eaffa354d2a');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as i,getContext as n,getElement as a,withSyncEvent as c}from"@wordpress/interactivity";var{actions:s}=i("core/search",{state:{get ariaLabel(){let{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=n();return e?r:t},get ariaControls(){let{isSearchInputVisible:e,inputId:t}=n();return e?null:t},get type(){let{isSearchInputVisible:e}=n();return e?"submit":"button"},get tabindex(){let{isSearchInputVisible:e}=n();return e?"0":"-1"}},actions:{openSearchInput:c(e=>{let t=n(),{ref:r}=a();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())}),closeSearchInput(){let e=n();e.isSearchInputVisible=!1},handleSearchKeydown:c(e=>{let{ref:t}=a();e?.key==="Escape"&&(s.closeSearchInput(),t.querySelector("button").focus())}),handleSearchFocusout:c(e=>{let{ref:t}=a();!t.contains(e.relatedTarget)&&e.target!==window.document.activeElement&&s.closeSearchInput()})}},{lock:!0});
|
||||
@@ -0,0 +1,246 @@
|
||||
// packages/block-library/build-module/tabs/view.mjs
|
||||
import {
|
||||
store,
|
||||
getContext,
|
||||
getElement,
|
||||
withSyncEvent
|
||||
} from "@wordpress/interactivity";
|
||||
function createReadOnlyProxy(obj) {
|
||||
const arrayMutationMethods = /* @__PURE__ */ new Set([
|
||||
"push",
|
||||
"pop",
|
||||
"shift",
|
||||
"unshift",
|
||||
"splice",
|
||||
"sort",
|
||||
"reverse",
|
||||
"copyWithin",
|
||||
"fill"
|
||||
]);
|
||||
return new Proxy(obj, {
|
||||
get(target, prop) {
|
||||
if (Array.isArray(target) && arrayMutationMethods.has(prop)) {
|
||||
return () => {
|
||||
};
|
||||
}
|
||||
const value = target[prop];
|
||||
if (typeof value === "object" && value !== null) {
|
||||
return createReadOnlyProxy(value);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
set() {
|
||||
return false;
|
||||
},
|
||||
deleteProperty() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
var { actions: privateActions, state: privateState } = store(
|
||||
"core/tabs/private",
|
||||
{
|
||||
state: {
|
||||
/**
|
||||
* Gets a contextually aware list of tabs for the current tabs block.
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
get tabsList() {
|
||||
const context = getContext();
|
||||
const tabsId = context?.tabsId;
|
||||
const tabsList = privateState[tabsId];
|
||||
return tabsList;
|
||||
},
|
||||
/**
|
||||
* Gets the index of the active tab element whether it
|
||||
* is a tab label or tab panel.
|
||||
*
|
||||
* @type {number|null}
|
||||
*/
|
||||
get tabIndex() {
|
||||
const { attributes } = getElement();
|
||||
const tabId = attributes?.id?.replace("tab__", "") || null;
|
||||
if (!tabId) {
|
||||
return null;
|
||||
}
|
||||
const { tabsList } = privateState;
|
||||
const tabIndex = tabsList.findIndex((t) => t.id === tabId);
|
||||
return tabIndex;
|
||||
},
|
||||
/**
|
||||
* Whether the tab panel or tab label is the active tab.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isActiveTab() {
|
||||
const { activeTabIndex } = getContext();
|
||||
const { tabIndex } = privateState;
|
||||
return activeTabIndex === tabIndex;
|
||||
},
|
||||
/**
|
||||
* The value of the tabindex attribute for tab buttons.
|
||||
* Only the active tab should be in the tab sequence.
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
get tabIndexAttribute() {
|
||||
return privateState.isActiveTab ? 0 : -1;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Handles the keydown events for the tab label and tabs controller.
|
||||
*
|
||||
* @param {KeyboardEvent} event The keydown event.
|
||||
*/
|
||||
handleTabKeyDown: withSyncEvent((event) => {
|
||||
const context = getContext();
|
||||
const { isVertical } = context;
|
||||
const { tabIndex } = privateState;
|
||||
if (tabIndex === null) {
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowRight" && !isVertical) {
|
||||
event.preventDefault();
|
||||
privateActions.moveFocus(tabIndex + 1);
|
||||
} else if (event.key === "ArrowLeft" && !isVertical) {
|
||||
event.preventDefault();
|
||||
privateActions.moveFocus(tabIndex - 1);
|
||||
} else if (event.key === "ArrowDown" && isVertical) {
|
||||
event.preventDefault();
|
||||
privateActions.moveFocus(tabIndex + 1);
|
||||
} else if (event.key === "ArrowUp" && isVertical) {
|
||||
event.preventDefault();
|
||||
privateActions.moveFocus(tabIndex - 1);
|
||||
}
|
||||
}),
|
||||
/**
|
||||
* Handles the click event for the tab label.
|
||||
*
|
||||
* @param {MouseEvent} event The click event.
|
||||
*/
|
||||
handleTabClick: withSyncEvent((event) => {
|
||||
event.preventDefault();
|
||||
const { tabIndex } = privateState;
|
||||
if (tabIndex !== null) {
|
||||
privateActions.setActiveTab(tabIndex);
|
||||
}
|
||||
}),
|
||||
/**
|
||||
* Moves focus to a specific tab without activating it.
|
||||
*
|
||||
* @param {number} tabIndex The index to move focus to.
|
||||
*/
|
||||
moveFocus: (tabIndex) => {
|
||||
const { tabsList } = privateState;
|
||||
if (!tabsList || tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
let newIndex = tabIndex;
|
||||
if (newIndex < 0) {
|
||||
newIndex = tabsList.length - 1;
|
||||
} else if (newIndex >= tabsList.length) {
|
||||
newIndex = 0;
|
||||
}
|
||||
const tabId = tabsList[newIndex].id;
|
||||
const tabElement = document.getElementById("tab__" + tabId);
|
||||
if (tabElement) {
|
||||
tabElement.focus();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Sets the active tab index (internal implementation).
|
||||
*
|
||||
* @param {number} tabIndex The index of the active tab.
|
||||
* @param {boolean} scrollToTab Whether to scroll to the tab element.
|
||||
*/
|
||||
setActiveTab: (tabIndex, scrollToTab = false) => {
|
||||
const { tabsList } = privateState;
|
||||
if (!tabsList || tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
let newIndex = tabIndex;
|
||||
if (newIndex < 0) {
|
||||
newIndex = 0;
|
||||
} else if (newIndex >= tabsList.length) {
|
||||
newIndex = tabsList.length - 1;
|
||||
}
|
||||
const context = getContext();
|
||||
context.activeTabIndex = newIndex;
|
||||
if (scrollToTab) {
|
||||
const tabId = tabsList[newIndex].id;
|
||||
const tabElement = document.getElementById(tabId);
|
||||
if (tabElement) {
|
||||
setTimeout(() => {
|
||||
tabElement.scrollIntoView({ behavior: "smooth" });
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
callbacks: {
|
||||
/**
|
||||
* When the tabs are initialized, we need to check if there is a hash in the url and if so if it exists in the current tabsList, set the active tab to that index.
|
||||
*
|
||||
*/
|
||||
onTabsInit: () => {
|
||||
const { tabsList } = privateState;
|
||||
if (tabsList.length === 0) {
|
||||
return;
|
||||
}
|
||||
const { hash } = window.location;
|
||||
const tabId = hash.replace("#", "");
|
||||
const tabIndex = tabsList.findIndex((t) => t.id === tabId);
|
||||
if (tabIndex >= 0) {
|
||||
privateActions.setActiveTab(tabIndex, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
lock: true
|
||||
}
|
||||
);
|
||||
store("core/tabs", {
|
||||
state: {
|
||||
/**
|
||||
* Gets a contextually aware list of tabs for the current tabs block.
|
||||
* Public API for third-party access.
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
get tabsList() {
|
||||
return createReadOnlyProxy(privateState.tabsList);
|
||||
},
|
||||
/**
|
||||
* Gets the index of the active tab element whether it
|
||||
* is a tab label or tab panel.
|
||||
*
|
||||
* @type {number|null}
|
||||
*/
|
||||
get tabIndex() {
|
||||
return privateState.tabIndex;
|
||||
},
|
||||
/**
|
||||
* Whether the tab panel or tab label is the active tab.
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isActiveTab() {
|
||||
return privateState.isActiveTab;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* Sets the active tab index.
|
||||
* Public API for third-party programmatic tab activation.
|
||||
*
|
||||
* @param {number} tabIndex The index of the active tab.
|
||||
* @param {boolean} scrollToTab Whether to scroll to the tab element.
|
||||
*/
|
||||
setActiveTab: (tabIndex, scrollToTab = false) => {
|
||||
privateActions.setActiveTab(tabIndex, scrollToTab);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '1f60dd5e3fa56c6b2e2e');
|
||||
@@ -0,0 +1 @@
|
||||
import{store as b,getContext as r,getElement as f,withSyncEvent as l}from"@wordpress/interactivity";function u(t){let e=new Set(["push","pop","shift","unshift","splice","sort","reverse","copyWithin","fill"]);return new Proxy(t,{get(n,s){if(Array.isArray(n)&&e.has(s))return()=>{};let a=n[s];return typeof a=="object"&&a!==null?u(a):a},set(){return!1},deleteProperty(){return!1}})}var{actions:o,state:i}=b("core/tabs/private",{state:{get tabsList(){let e=r()?.tabsId;return i[e]},get tabIndex(){let{attributes:t}=f(),e=t?.id?.replace("tab__","")||null;if(!e)return null;let{tabsList:n}=i;return n.findIndex(a=>a.id===e)},get isActiveTab(){let{activeTabIndex:t}=r(),{tabIndex:e}=i;return t===e},get tabIndexAttribute(){return i.isActiveTab?0:-1}},actions:{handleTabKeyDown:l(t=>{let e=r(),{isVertical:n}=e,{tabIndex:s}=i;s!==null&&(t.key==="ArrowRight"&&!n?(t.preventDefault(),o.moveFocus(s+1)):t.key==="ArrowLeft"&&!n?(t.preventDefault(),o.moveFocus(s-1)):t.key==="ArrowDown"&&n?(t.preventDefault(),o.moveFocus(s+1)):t.key==="ArrowUp"&&n&&(t.preventDefault(),o.moveFocus(s-1)))}),handleTabClick:l(t=>{t.preventDefault();let{tabIndex:e}=i;e!==null&&o.setActiveTab(e)}),moveFocus:t=>{let{tabsList:e}=i;if(!e||e.length===0)return;let n=t;n<0?n=e.length-1:n>=e.length&&(n=0);let s=e[n].id,a=document.getElementById("tab__"+s);a&&a.focus()},setActiveTab:(t,e=!1)=>{let{tabsList:n}=i;if(!n||n.length===0)return;let s=t;s<0?s=0:s>=n.length&&(s=n.length-1);let a=r();if(a.activeTabIndex=s,e){let d=n[s].id,c=document.getElementById(d);c&&setTimeout(()=>{c.scrollIntoView({behavior:"smooth"})},100)}}},callbacks:{onTabsInit:()=>{let{tabsList:t}=i;if(t.length===0)return;let{hash:e}=window.location,n=e.replace("#",""),s=t.findIndex(a=>a.id===n);s>=0&&o.setActiveTab(s,!0)}}},{lock:!0});b("core/tabs",{state:{get tabsList(){return u(i.tabsList)},get tabIndex(){return i.tabIndex},get isActiveTab(){return i.isActiveTab}},actions:{setActiveTab:(t,e=!1)=>{o.setActiveTab(t,e)}}});
|
||||
+2435
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/lazy-editor', 'import' => 'dynamic'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '54bb5a420026a61c7e4f');
|
||||
@@ -0,0 +1 @@
|
||||
var $a=Object.create;var ee=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var Xa=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Za=Object.prototype.hasOwnProperty;var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ye=(t,e)=>{for(var o in e)ee(t,o,{get:e[o],enumerable:!0})},Qa=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xa(e))!Za.call(t,r)&&r!==o&&ee(t,r,{get:()=>e[r],enumerable:!(a=Ka(e,r))||a.enumerable});return t};var i=(t,e,o)=>(o=t!=null?$a(Ja(t)):{},Qa(e||!t||!t.__esModule?ee(o,"default",{value:t,enumerable:!0}):o,t));var w=g((_i,$e)=>{$e.exports=window.wp.element});var k=g((yi,Ke)=>{Ke.exports=window.wp.data});var S=g((ki,Xe)=>{Xe.exports=window.wp.i18n});var v=g((Si,Je)=>{Je.exports=window.wp.components});var f=g((Ri,Ze)=>{Ze.exports=window.ReactJSXRuntime});var X=g((Ci,ro)=>{ro.exports=window.React});var R=g((rs,_o)=>{_o.exports=window.wp.primitives});var ko=g((Ps,yo)=>{yo.exports=window.wp.theme});var Ro=g((Ts,So)=>{So.exports=window.wp.privateApis});var ut=g((Ls,Io)=>{Io.exports=window.wp.compose});var F=g(($s,Ao)=>{Ao.exports=window.wp.coreData});var Ce=g((Ks,Mo)=>{Mo.exports=window.wp.notices});var Pe=g((Xs,Do)=>{Do.exports=window.wp.htmlEntities});var Te=g((Js,zo)=>{zo.exports=window.wp.keycodes});var Bo=g((Zs,jo)=>{jo.exports=window.wp.commands});var Uo=g((Qs,Oo)=>{Oo.exports=window.wp.url});var Ut=g((Xn,ga)=>{ga.exports=window.wp.editor});var wa=g((Jn,ba)=>{ba.exports=window.wp.keyboardShortcuts});var nt=i(w(),1),K=i(k(),1);var qe=i(S(),1),Ua=i(w(),1);function Qe(t){var e,o,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(o=Qe(t[e]))&&(a&&(a+=" "),a+=o)}else for(o in t)t[o]&&(a&&(a+=" "),a+=o);return a}function tr(){for(var t,e,o=0,a="",r=arguments.length;o<r;o++)(t=arguments[o])&&(e=Qe(t))&&(a&&(a+=" "),a+=e);return a}var h=tr;var to=i(w(),1),eo=i(f(),1),oo=(0,to.forwardRef)(({children:t,className:e,ariaLabel:o,as:a="div",...r},s)=>(0,eo.jsx)(a,{ref:s,className:h("admin-ui-navigable-region",e),"aria-label":o,role:"region",tabIndex:"-1",...r,children:t}));oo.displayName="NavigableRegion";var ao=oo;var so=i(X(),1),io={};function oe(t,e){let o=so.useRef(io);return o.current===io&&(o.current=t(e)),o}function ae(t,...e){let o=new URL(`https://base-ui.com/production-error/${t}`);return e.forEach(a=>o.searchParams.append("args[]",a)),`Base UI error #${t}; visit ${o} for the full message.`}var vt=i(X(),1);function re(t,e,o,a){let r=oe(lo).current;return er(r,t,e,o,a)&&fo(r,[t,e,o,a]),r.callback}function no(t){let e=oe(lo).current;return or(e,t)&&fo(e,t),e.callback}function lo(){return{callback:null,cleanup:null,refs:[]}}function er(t,e,o,a,r){return t.refs[0]!==e||t.refs[1]!==o||t.refs[2]!==a||t.refs[3]!==r}function or(t,e){return t.refs.length!==e.length||t.refs.some((o,a)=>o!==e[a])}function fo(t,e){if(t.refs=e,e.every(o=>o==null)){t.callback=null;return}t.callback=o=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),o!=null){let a=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){let s=e[r];if(s!=null)switch(typeof s){case"function":{let n=s(o);typeof n=="function"&&(a[r]=n);break}case"object":{s.current=o;break}default:}}t.cleanup=()=>{for(let r=0;r<e.length;r+=1){let s=e[r];if(s!=null)switch(typeof s){case"function":{let n=a[r];typeof n=="function"?n():s(null);break}case"object":{s.current=null;break}default:}}}}}}var po=i(X(),1);var uo=i(X(),1),ar=parseInt(uo.version,10);function mo(t){return ar>=t}function ie(t){if(!po.isValidElement(t))return null;let e=t,o=e.props;return(mo(19)?o?.ref:e.ref)??null}function lt(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function co(t,e){let o={};for(let a in t){let r=t[a];if(e?.hasOwnProperty(a)){let s=e[a](r);s!=null&&Object.assign(o,s);continue}r===!0?o[`data-${a.toLowerCase()}`]="":r&&(o[`data-${a.toLowerCase()}`]=r.toString())}return o}function ho(t,e){return typeof t=="function"?t(e):t}function go(t,e){return typeof t=="function"?t(e):t}var ft={};function wt(t,e,o,a,r){let s={...se(t,ft)};return e&&(s=dt(s,e)),o&&(s=dt(s,o)),a&&(s=dt(s,a)),r&&(s=dt(s,r)),s}function bo(t){if(t.length===0)return ft;if(t.length===1)return se(t[0],ft);let e={...se(t[0],ft)};for(let o=1;o<t.length;o+=1)e=dt(e,t[o]);return e}function dt(t,e){return wo(e)?e(t):rr(t,e)}function rr(t,e){if(!e)return t;for(let o in e){let a=e[o];switch(o){case"style":{t[o]=lt(t.style,a);break}case"className":{t[o]=ne(t.className,a);break}default:ir(o,a)?t[o]=sr(t[o],a):t[o]=a}}return t}function ir(t,e){let o=t.charCodeAt(0),a=t.charCodeAt(1),r=t.charCodeAt(2);return o===111&&a===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function wo(t){return typeof t=="function"}function se(t,e){return wo(t)?t(e):t??ft}function sr(t,e){return e?t?o=>{if(lr(o)){let r=o;nr(r);let s=e(r);return r.baseUIHandlerPrevented||t?.(r),s}let a=e(o);return t?.(o),a}:e:t}function nr(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPreveLine truncated
|
||||
@@ -0,0 +1,318 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/data
|
||||
var require_data = __commonJS({
|
||||
"package-external:@wordpress/data"(exports, module) {
|
||||
module.exports = window.wp.data;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/private-apis
|
||||
var require_private_apis = __commonJS({
|
||||
"package-external:@wordpress/private-apis"(exports, module) {
|
||||
module.exports = window.wp.privateApis;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/components
|
||||
var require_components = __commonJS({
|
||||
"package-external:@wordpress/components"(exports, module) {
|
||||
module.exports = window.wp.components;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/element
|
||||
var require_element = __commonJS({
|
||||
"package-external:@wordpress/element"(exports, module) {
|
||||
module.exports = window.wp.element;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/i18n
|
||||
var require_i18n = __commonJS({
|
||||
"package-external:@wordpress/i18n"(exports, module) {
|
||||
module.exports = window.wp.i18n;
|
||||
}
|
||||
});
|
||||
|
||||
// vendor-external:react/jsx-runtime
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"vendor-external:react/jsx-runtime"(exports, module) {
|
||||
module.exports = window.ReactJSXRuntime;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/connectors/build-module/api.mjs
|
||||
var import_data2 = __toESM(require_data(), 1);
|
||||
|
||||
// packages/connectors/build-module/store.mjs
|
||||
var import_data = __toESM(require_data(), 1);
|
||||
|
||||
// packages/connectors/build-module/lock-unlock.mjs
|
||||
var import_private_apis = __toESM(require_private_apis(), 1);
|
||||
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
||||
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
||||
"@wordpress/connectors"
|
||||
);
|
||||
|
||||
// packages/connectors/build-module/store.mjs
|
||||
var STORE_NAME = "core/connectors";
|
||||
var DEFAULT_STATE = {
|
||||
connectors: {}
|
||||
};
|
||||
var actions = {
|
||||
registerConnector(slug, config) {
|
||||
return {
|
||||
type: "REGISTER_CONNECTOR",
|
||||
slug,
|
||||
config
|
||||
};
|
||||
},
|
||||
unregisterConnector(slug) {
|
||||
return {
|
||||
type: "UNREGISTER_CONNECTOR",
|
||||
slug
|
||||
};
|
||||
}
|
||||
};
|
||||
function reducer(state = DEFAULT_STATE, action) {
|
||||
switch (action.type) {
|
||||
case "REGISTER_CONNECTOR":
|
||||
return {
|
||||
...state,
|
||||
connectors: {
|
||||
...state.connectors,
|
||||
[action.slug]: {
|
||||
...state.connectors[action.slug],
|
||||
slug: action.slug,
|
||||
...action.config
|
||||
}
|
||||
}
|
||||
};
|
||||
case "UNREGISTER_CONNECTOR": {
|
||||
if (!state.connectors[action.slug]) {
|
||||
return state;
|
||||
}
|
||||
const { [action.slug]: _, ...rest } = state.connectors;
|
||||
return {
|
||||
...state,
|
||||
connectors: rest
|
||||
};
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
var selectors = {
|
||||
getConnectors: (0, import_data.createSelector)(
|
||||
(state) => Object.values(state.connectors),
|
||||
(state) => [state.connectors]
|
||||
),
|
||||
getConnector(state, slug) {
|
||||
return state.connectors[slug];
|
||||
}
|
||||
};
|
||||
var store = (0, import_data.createReduxStore)(STORE_NAME, {
|
||||
reducer
|
||||
});
|
||||
(0, import_data.register)(store);
|
||||
unlock(store).registerPrivateActions(actions);
|
||||
unlock(store).registerPrivateSelectors(selectors);
|
||||
|
||||
// packages/connectors/build-module/api.mjs
|
||||
function registerConnector(slug, config) {
|
||||
unlock((0, import_data2.dispatch)(store)).registerConnector(slug, config);
|
||||
}
|
||||
function unregisterConnector(slug) {
|
||||
unlock((0, import_data2.dispatch)(store)).unregisterConnector(slug);
|
||||
}
|
||||
|
||||
// packages/connectors/build-module/connector-item.mjs
|
||||
var import_components = __toESM(require_components(), 1);
|
||||
var import_element = __toESM(require_element(), 1);
|
||||
var import_i18n = __toESM(require_i18n(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function ConnectorItem({
|
||||
className,
|
||||
logo,
|
||||
name,
|
||||
description,
|
||||
actionArea,
|
||||
children
|
||||
}) {
|
||||
const headingId = (0, import_element.useId)();
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 4, role: "group", "aria-labelledby": headingId, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "center", spacing: 4, wrap: true, children: [
|
||||
logo,
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexBlock, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: 0, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.__experimentalText,
|
||||
{
|
||||
weight: 600,
|
||||
size: 15,
|
||||
id: headingId,
|
||||
as: "h2",
|
||||
children: name
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalText, { variant: "muted", size: 12, children: description })
|
||||
] }) }),
|
||||
actionArea
|
||||
] }),
|
||||
children
|
||||
] }) });
|
||||
}
|
||||
function DefaultConnectorSettings({
|
||||
onSave,
|
||||
onRemove,
|
||||
initialValue = "",
|
||||
helpUrl,
|
||||
helpLabel,
|
||||
readOnly = false,
|
||||
keySource
|
||||
}) {
|
||||
const [apiKey, setApiKey] = (0, import_element.useState)(initialValue);
|
||||
const [isSaving, setIsSaving] = (0, import_element.useState)(false);
|
||||
const [saveError, setSaveError] = (0, import_element.useState)(null);
|
||||
const helpLinkLabel = helpLabel || helpUrl?.replace(/^https?:\/\//, "");
|
||||
const helpLink = helpUrl ? (0, import_element.createInterpolateElement)(
|
||||
(0, import_i18n.sprintf)(
|
||||
/* translators: %s: Link to provider settings. */
|
||||
(0, import_i18n.__)("Get your API key at %s"),
|
||||
"<a></a>"
|
||||
),
|
||||
{
|
||||
a: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ExternalLink, { href: helpUrl, children: helpLinkLabel })
|
||||
}
|
||||
) : void 0;
|
||||
const isExternallyConfigured = keySource === "env" || keySource === "constant";
|
||||
const getHelp = () => {
|
||||
if (isExternallyConfigured) {
|
||||
if (keySource === "env") {
|
||||
return (0, import_i18n.__)(
|
||||
"This API key is configured using an environment variable."
|
||||
);
|
||||
}
|
||||
if (keySource === "constant") {
|
||||
return (0, import_i18n.__)("This API key is configured as a constant.");
|
||||
}
|
||||
}
|
||||
if (readOnly) {
|
||||
return helpUrl ? (0, import_element.createInterpolateElement)(
|
||||
(0, import_i18n.sprintf)(
|
||||
/* translators: %s: Link to provider settings. */
|
||||
(0, import_i18n.__)(
|
||||
"Your API key is stored securely. You can manage it at %s"
|
||||
),
|
||||
"<a></a>"
|
||||
),
|
||||
{
|
||||
a: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ExternalLink, { href: helpUrl, children: helpLinkLabel })
|
||||
}
|
||||
) : (0, import_i18n.__)("Your API key is stored securely.");
|
||||
}
|
||||
if (saveError) {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "alert", className: "connector-settings__error", children: saveError });
|
||||
}
|
||||
return helpLink;
|
||||
};
|
||||
const handleSave = async () => {
|
||||
setSaveError(null);
|
||||
setIsSaving(true);
|
||||
try {
|
||||
await onSave?.(apiKey);
|
||||
} catch (error) {
|
||||
setSaveError(
|
||||
error instanceof Error ? error.message : (0, import_i18n.__)(
|
||||
"It was not possible to connect to the provider using this key."
|
||||
)
|
||||
);
|
||||
} finally {
|
||||
setIsSaving(false);
|
||||
}
|
||||
};
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
||||
import_components.__experimentalVStack,
|
||||
{
|
||||
spacing: 4,
|
||||
className: "connector-settings",
|
||||
style: readOnly ? {
|
||||
"--wp-components-color-background": "#f0f0f0"
|
||||
} : void 0,
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.TextControl,
|
||||
{
|
||||
__next40pxDefaultSize: true,
|
||||
label: (0, import_i18n.__)("API Key"),
|
||||
value: apiKey,
|
||||
onChange: (value) => {
|
||||
if (!readOnly) {
|
||||
setSaveError(null);
|
||||
setApiKey(value);
|
||||
}
|
||||
},
|
||||
placeholder: (0, import_i18n.__)("Enter your API key"),
|
||||
disabled: readOnly || isSaving,
|
||||
help: getHelp()
|
||||
}
|
||||
),
|
||||
readOnly ? onRemove && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHStack, { justify: "flex-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.Button,
|
||||
{
|
||||
variant: "link",
|
||||
isDestructive: true,
|
||||
onClick: onRemove,
|
||||
children: (0, import_i18n.__)("Remove and replace")
|
||||
}
|
||||
) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHStack, { justify: "flex-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
||||
import_components.Button,
|
||||
{
|
||||
__next40pxDefaultSize: true,
|
||||
variant: "primary",
|
||||
disabled: !apiKey || isSaving,
|
||||
accessibleWhenDisabled: true,
|
||||
isBusy: isSaving,
|
||||
onClick: handleSave,
|
||||
children: (0, import_i18n.__)("Save")
|
||||
}
|
||||
) })
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// packages/connectors/build-module/private-apis.mjs
|
||||
var privateApis = {};
|
||||
lock(privateApis, { store, STORE_NAME });
|
||||
export {
|
||||
ConnectorItem as __experimentalConnectorItem,
|
||||
DefaultConnectorSettings as __experimentalDefaultConnectorSettings,
|
||||
registerConnector as __experimentalRegisterConnector,
|
||||
unregisterConnector as __experimentalUnregisterConnector,
|
||||
privateApis
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-private-apis'), 'version' => '274797868955a828dfdc');
|
||||
@@ -0,0 +1 @@
|
||||
var W=Object.create;var y=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var f=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Q=(e,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of U(r))!q.call(e,c)&&c!==i&&y(e,c,{get:()=>r[c],enumerable:!(s=J(r,c))||s.enumerable});return e};var m=(e,r,i)=>(i=e!=null?W(X(e)):{},Q(r||!e||!e.__esModule?y(i,"default",{value:e,enumerable:!0}):i,e));var C=f((ce,T)=>{T.exports=window.wp.data});var A=f((ae,R)=>{R.exports=window.wp.privateApis});var O=f((ge,P)=>{P.exports=window.wp.components});var j=f((xe,D)=>{D.exports=window.wp.element});var L=f((_e,G)=>{G.exports=window.wp.i18n});var B=f((he,z)=>{z.exports=window.ReactJSXRuntime});var E=m(C(),1);var g=m(C(),1);var b=m(A(),1),{lock:N,unlock:d}=(0,b.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/connectors");var w="core/connectors",Z={connectors:{}},$={registerConnector(e,r){return{type:"REGISTER_CONNECTOR",slug:e,config:r}},unregisterConnector(e){return{type:"UNREGISTER_CONNECTOR",slug:e}}};function ee(e=Z,r){switch(r.type){case"REGISTER_CONNECTOR":return{...e,connectors:{...e.connectors,[r.slug]:{...e.connectors[r.slug],slug:r.slug,...r.config}}};case"UNREGISTER_CONNECTOR":{if(!e.connectors[r.slug])return e;let{[r.slug]:i,...s}=e.connectors;return{...e,connectors:s}}default:return e}}var re={getConnectors:(0,g.createSelector)(e=>Object.values(e.connectors),e=>[e.connectors]),getConnector(e,r){return e.connectors[r]}},l=(0,g.createReduxStore)(w,{reducer:ee});(0,g.register)(l);d(l).registerPrivateActions($);d(l).registerPrivateSelectors(re);function te(e,r){d((0,E.dispatch)(l)).registerConnector(e,r)}function ne(e){d((0,E.dispatch)(l)).unregisterConnector(e)}var t=m(O(),1),a=m(j(),1),o=m(L(),1),n=m(B(),1);function oe({className:e,logo:r,name:i,description:s,actionArea:c,children:p}){let u=(0,a.useId)();return(0,n.jsx)(t.__experimentalItem,{className:e,children:(0,n.jsxs)(t.__experimentalVStack,{spacing:4,role:"group","aria-labelledby":u,children:[(0,n.jsxs)(t.__experimentalHStack,{alignment:"center",spacing:4,wrap:!0,children:[r,(0,n.jsx)(t.FlexBlock,{children:(0,n.jsxs)(t.__experimentalVStack,{spacing:0,children:[(0,n.jsx)(t.__experimentalText,{weight:600,size:15,id:u,as:"h2",children:i}),(0,n.jsx)(t.__experimentalText,{variant:"muted",size:12,children:s})]})}),c]}),p]})})}function se({onSave:e,onRemove:r,initialValue:i="",helpUrl:s,helpLabel:c,readOnly:p=!1,keySource:u}){let[_,H]=(0,a.useState)(i),[h,I]=(0,a.useState)(!1),[k,v]=(0,a.useState)(null),S=c||s?.replace(/^https?:\/\//,""),K=s?(0,a.createInterpolateElement)((0,o.sprintf)((0,o.__)("Get your API key at %s"),"<a></a>"),{a:(0,n.jsx)(t.ExternalLink,{href:s,children:S})}):void 0,M=u==="env"||u==="constant",Y=()=>{if(M){if(u==="env")return(0,o.__)("This API key is configured using an environment variable.");if(u==="constant")return(0,o.__)("This API key is configured as a constant.")}return p?s?(0,a.createInterpolateElement)((0,o.sprintf)((0,o.__)("Your API key is stored securely. You can manage it at %s"),"<a></a>"),{a:(0,n.jsx)(t.ExternalLink,{href:s,children:S})}):(0,o.__)("Your API key is stored securely."):k?(0,n.jsx)("span",{role:"alert",className:"connector-settings__error",children:k}):K},V=async()=>{v(null),I(!0);try{await e?.(_)}catch(x){v(x instanceof Error?x.message:(0,o.__)("It was not possible to connect to the provider using this key."))}finally{I(!1)}};return(0,n.jsxs)(t.__experimentalVStack,{spacing:4,className:"connector-settings",style:p?{"--wp-components-color-background":"#f0f0f0"}:void 0,children:[(0,n.jsx)(t.TextControl,{__next40pxDefaultSize:!0,label:(0,o.__)("API Key"),value:_,onChange:x=>{p||(v(null),H(x))},placeholder:(0,o.__)("Enter your API key"),disabled:p||h,help:Y()}),p?r&&(0,n.jsx)(t.__experimentalHStack,{justify:"flex-start",children:(0,n.jsx)(t.Button,{variant:"link",isDestructive:!0,onClick:r,children:(0,o.__)("Remove and replace")})}):(0,n.jsx)(t.__experimentalHStack,{justify:"flex-start",children:(0,n.jsx)(t.Button,{__next40pxDefaultSize:!0,variant:"primary",disabled:!_||h,accessibleWhenDisabled:!0,isBusy:h,onClick:V,children:(0,o.__)("Save")})})]})}var F={};N(F,{store:l,STORE_NAME:w});export{oe as __experimentalConnectorItem,se as __experimentalDefaultConnectorSettings,te as __experimentalRegisterConnector,ne as __experimentalUnregisterConnector,F as privateApis};
|
||||
@@ -0,0 +1,127 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/api-fetch
|
||||
var require_api_fetch = __commonJS({
|
||||
"package-external:@wordpress/api-fetch"(exports, module) {
|
||||
module.exports = window.wp.apiFetch;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/url
|
||||
var require_url = __commonJS({
|
||||
"package-external:@wordpress/url"(exports, module) {
|
||||
module.exports = window.wp.url;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/core-abilities/build-module/index.mjs
|
||||
var import_api_fetch = __toESM(require_api_fetch(), 1);
|
||||
var import_url = __toESM(require_url(), 1);
|
||||
import { registerAbility, registerAbilityCategory } from "@wordpress/abilities";
|
||||
var API_BASE = "/wp-abilities/v1";
|
||||
var ABILITIES_ENDPOINT = `${API_BASE}/abilities`;
|
||||
var CATEGORIES_ENDPOINT = `${API_BASE}/categories`;
|
||||
function createServerCallback(ability) {
|
||||
return async (input) => {
|
||||
let method = "POST";
|
||||
if (!!ability.meta?.annotations?.readonly) {
|
||||
method = "GET";
|
||||
} else if (!!ability.meta?.annotations?.destructive && !!ability.meta?.annotations?.idempotent) {
|
||||
method = "DELETE";
|
||||
}
|
||||
let path = `${ABILITIES_ENDPOINT}/${ability.name}/run`;
|
||||
const options = {
|
||||
method
|
||||
};
|
||||
if (["GET", "DELETE"].includes(method) && input !== null && input !== void 0) {
|
||||
path = (0, import_url.addQueryArgs)(path, { input });
|
||||
} else if (method === "POST" && input !== null && input !== void 0) {
|
||||
options.data = { input };
|
||||
}
|
||||
return (0, import_api_fetch.default)({
|
||||
path,
|
||||
...options
|
||||
});
|
||||
};
|
||||
}
|
||||
async function initializeCategories() {
|
||||
try {
|
||||
const categories = await (0, import_api_fetch.default)({
|
||||
path: (0, import_url.addQueryArgs)(CATEGORIES_ENDPOINT, {
|
||||
per_page: -1,
|
||||
context: "edit"
|
||||
})
|
||||
});
|
||||
if (categories && Array.isArray(categories)) {
|
||||
for (const category of categories) {
|
||||
registerAbilityCategory(category.slug, {
|
||||
label: category.label,
|
||||
description: category.description,
|
||||
meta: {
|
||||
annotations: { serverRegistered: true }
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch ability categories:", error);
|
||||
}
|
||||
}
|
||||
async function initializeAbilities() {
|
||||
try {
|
||||
const abilities = await (0, import_api_fetch.default)({
|
||||
path: (0, import_url.addQueryArgs)(ABILITIES_ENDPOINT, {
|
||||
per_page: -1,
|
||||
context: "edit"
|
||||
})
|
||||
});
|
||||
if (abilities && Array.isArray(abilities)) {
|
||||
for (const ability of abilities) {
|
||||
registerAbility({
|
||||
...ability,
|
||||
callback: createServerCallback(ability),
|
||||
meta: {
|
||||
annotations: {
|
||||
...ability.meta?.annotations,
|
||||
serverRegistered: true
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch abilities:", error);
|
||||
}
|
||||
}
|
||||
async function initialize() {
|
||||
await initializeCategories();
|
||||
await initializeAbilities();
|
||||
}
|
||||
var ready = initialize();
|
||||
export {
|
||||
ready
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-api-fetch', 'wp-url'), 'module_dependencies' => array(array('id' => '@wordpress/abilities', 'import' => 'static')), 'version' => '012760fd849397dd0031');
|
||||
@@ -0,0 +1 @@
|
||||
var E=Object.create;var s=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var b=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of u(t))!w.call(e,a)&&a!==i&&s(e,a,{get:()=>t[a],enumerable:!(r=A(t,a))||r.enumerable});return e};var l=(e,t,i)=>(i=e!=null?E(v(e)):{},b(t||!e||!e.__esModule?s(i,"default",{value:e,enumerable:!0}):i,e));var f=c((C,d)=>{d.exports=window.wp.apiFetch});var y=c((D,p)=>{p.exports=window.wp.url});var o=l(f(),1),n=l(y(),1);import{registerAbility as h,registerAbilityCategory as T}from"@wordpress/abilities";var m="/wp-abilities/v1",g=`${m}/abilities`,I=`${m}/categories`;function S(e){return async t=>{let i="POST";e.meta?.annotations?.readonly?i="GET":e.meta?.annotations?.destructive&&e.meta?.annotations?.idempotent&&(i="DELETE");let r=`${g}/${e.name}/run`,a={method:i};return["GET","DELETE"].includes(i)&&t!==null&&t!==void 0?r=(0,n.addQueryArgs)(r,{input:t}):i==="POST"&&t!==null&&t!==void 0&&(a.data={input:t}),(0,o.default)({path:r,...a})}}async function x(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(I,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)T(t.slug,{label:t.label,description:t.description,meta:{annotations:{serverRegistered:!0}}})}catch(e){console.error("Failed to fetch ability categories:",e)}}async function O(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(g,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)h({...t,callback:S(t),meta:{annotations:{...t.meta?.annotations,serverRegistered:!0}}})}catch(e){console.error("Failed to fetch abilities:",e)}}async function P(){await x(),await O()}var N=P();export{N as ready};
|
||||
@@ -0,0 +1,111 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// package-external:@wordpress/primitives
|
||||
var require_primitives = __commonJS({
|
||||
"package-external:@wordpress/primitives"(exports, module) {
|
||||
module.exports = window.wp.primitives;
|
||||
}
|
||||
});
|
||||
|
||||
// vendor-external:react/jsx-runtime
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"vendor-external:react/jsx-runtime"(exports, module) {
|
||||
module.exports = window.ReactJSXRuntime;
|
||||
}
|
||||
});
|
||||
|
||||
// package-external:@wordpress/data
|
||||
var require_data = __commonJS({
|
||||
"package-external:@wordpress/data"(exports, module) {
|
||||
module.exports = window.wp.data;
|
||||
}
|
||||
});
|
||||
|
||||
// packages/icons/build-module/library/home.mjs
|
||||
var import_primitives = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
var home_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) });
|
||||
|
||||
// packages/icons/build-module/library/layout.mjs
|
||||
var import_primitives2 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
var layout_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) });
|
||||
|
||||
// packages/icons/build-module/library/navigation.mjs
|
||||
var import_primitives3 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
||||
var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" }) });
|
||||
|
||||
// packages/icons/build-module/library/page.mjs
|
||||
var import_primitives4 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
||||
var page_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })
|
||||
] });
|
||||
|
||||
// packages/icons/build-module/library/styles.mjs
|
||||
var import_primitives5 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
||||
var styles_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" }) });
|
||||
|
||||
// packages/icons/build-module/library/symbol-filled.mjs
|
||||
var import_primitives6 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
||||
var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
|
||||
|
||||
// packages/icons/build-module/library/symbol.mjs
|
||||
var import_primitives7 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
||||
var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) });
|
||||
|
||||
// packages/icons/build-module/library/typography.mjs
|
||||
var import_primitives8 = __toESM(require_primitives(), 1);
|
||||
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
||||
var typography_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z" }) });
|
||||
|
||||
// packages/edit-site-init/build-module/index.mjs
|
||||
var import_data = __toESM(require_data(), 1);
|
||||
import { store as bootStore } from "@wordpress/boot";
|
||||
async function init() {
|
||||
const menuIcons = {
|
||||
home: { icon: home_default },
|
||||
styles: { icon: styles_default },
|
||||
navigation: { icon: navigation_default },
|
||||
pages: { icon: page_default },
|
||||
templateParts: { icon: symbol_filled_default },
|
||||
patterns: { icon: symbol_default },
|
||||
templates: { icon: layout_default },
|
||||
fontList: { icon: typography_default }
|
||||
};
|
||||
Object.entries(menuIcons).forEach(([id, { icon }]) => {
|
||||
(0, import_data.dispatch)(bootStore).updateMenuItem(id, { icon });
|
||||
});
|
||||
}
|
||||
export {
|
||||
init
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-primitives'), 'module_dependencies' => array(array('id' => '@wordpress/boot', 'import' => 'static')), 'version' => 'e57f44d1a9f69e75d2d9');
|
||||
@@ -0,0 +1 @@
|
||||
var Z=Object.create;var H=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var g=(f,t)=>()=>(t||f((t={exports:{}}).exports,t),t.exports);var q=(f,t,r,D)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of _(t))!N.call(f,l)&&l!==r&&H(f,l,{get:()=>t[l],enumerable:!(D=I(t,l))||D.enumerable});return f};var a=(f,t,r)=>(r=f!=null?Z(G(f)):{},q(t||!f||!f.__esModule?H(r,"default",{value:f,enumerable:!0}):r,f));var e=g((J,M)=>{M.exports=window.wp.primitives});var o=g((W,P)=>{P.exports=window.ReactJSXRuntime});var A=g((pa,U)=>{U.exports=window.wp.data});var d=a(e(),1),w=a(o(),1),v=(0,w.jsx)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(d.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})});var u=a(e(),1),b=a(o(),1),y=(0,b.jsx)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,b.jsx)(u.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});var i=a(e(),1),x=a(o(),1),L=(0,x.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x.jsx)(i.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})});var s=a(e(),1),m=a(o(),1),R=(0,m.jsxs)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,m.jsx)(s.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,m.jsx)(s.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]});var p=a(e(),1),V=a(o(),1),S=(0,V.jsx)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,V.jsx)(p.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})});var n=a(e(),1),k=a(o(),1),B=(0,k.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,k.jsx)(n.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});var c=a(e(),1),C=a(o(),1),j=(0,C.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,C.jsx)(c.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});var h=a(e(),1),z=a(o(),1),T=(0,z.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,z.jsx)(h.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})});var F=a(A(),1);import{store as O}from"@wordpress/boot";async function ha(){Object.entries({home:{icon:v},styles:{icon:S},navigation:{icon:L},pages:{icon:R},templateParts:{icon:B},patterns:{icon:j},templates:{icon:y},fontList:{icon:T}}).forEach(([t,{icon:r}])=>{(0,F.dispatch)(O).updateMenuItem(t,{icon:r})})}export{ha as init};
|
||||
@@ -0,0 +1,28 @@
|
||||
// packages/interactivity-router/build-module/full-page.mjs
|
||||
var isValidLink = (ref) => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === "_self") && ref.origin === window.location.origin && !ref.pathname.startsWith("/wp-admin") && !ref.pathname.startsWith("/wp-login.php") && !ref.getAttribute("href").startsWith("#") && !new URL(ref.href).searchParams.has("_wpnonce");
|
||||
var isValidEvent = (event) => event && event.button === 0 && // Left clicks only.
|
||||
!event.metaKey && // Open in new tab (Mac).
|
||||
!event.ctrlKey && // Open in new tab (Windows).
|
||||
!event.altKey && // Download.
|
||||
!event.shiftKey && !event.defaultPrevented;
|
||||
document.addEventListener("click", async (event) => {
|
||||
const ref = event.target.closest("a");
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
event.preventDefault();
|
||||
const { actions } = await import("@wordpress/interactivity-router");
|
||||
actions.navigate(ref.href);
|
||||
}
|
||||
});
|
||||
document.addEventListener(
|
||||
"mouseenter",
|
||||
async (event) => {
|
||||
if (event.target?.nodeName === "A") {
|
||||
const ref = event.target.closest("a");
|
||||
if (isValidLink(ref) && isValidEvent(event)) {
|
||||
const { actions } = await import("@wordpress/interactivity-router");
|
||||
actions.prefetch(ref.href);
|
||||
}
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '5c07cd7a12ae073c5241');
|
||||
@@ -0,0 +1 @@
|
||||
var s=t=>t&&t instanceof window.HTMLAnchorElement&&t.href&&(!t.target||t.target==="_self")&&t.origin===window.location.origin&&!t.pathname.startsWith("/wp-admin")&&!t.pathname.startsWith("/wp-login.php")&&!t.getAttribute("href").startsWith("#")&&!new URL(t.href).searchParams.has("_wpnonce"),n=t=>t&&t.button===0&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.defaultPrevented;document.addEventListener("click",async t=>{let a=t.target.closest("a");if(s(a)&&n(t)){t.preventDefault();let{actions:i}=await import("@wordpress/interactivity-router");i.navigate(a.href)}});document.addEventListener("mouseenter",async t=>{if(t.target?.nodeName==="A"){let a=t.target.closest("a");if(s(a)&&n(t)){let{actions:i}=await import("@wordpress/interactivity-router");i.prefetch(a.href)}}},!0);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'dynamic'), array('id' => '@wordpress/interactivity', 'import' => 'static')), 'version' => '71aa17bac91628a0f874');
|
||||
@@ -0,0 +1,7 @@
|
||||
import{store as mA,privateApis as jA,getConfig as uA}from"@wordpress/interactivity";function V(A,e,t=(Q,o)=>Q===o){let Q=A.length,o=e.length,B=Array.from({length:Q+1},()=>Array(o+1).fill(null));for(let E=0;E<=Q;E++)B[E][0]=A.slice(0,E);for(let E=0;E<=o;E++)B[0][E]=e.slice(0,E);for(let E=1;E<=Q;E++)for(let i=1;i<=o;i++)if(t(A[E-1],e[i-1]))B[E][i]=B[E-1][i-1].concat(A[E-1]);else{let s=B[E-1][i].concat(A[E-1]),C=B[E][i-1].concat(e[i-1]);B[E][i]=s.length<=C.length?s:C}return B[Q][o]}var U=(A,e)=>A.isEqualNode(e),W=A=>{A=A.cloneNode(!0);let e=A.media,{originalMedia:t}=A.dataset;return e==="preload"?(A.media=t||"all",A.removeAttribute("data-original-media")):A.media||(A.media="all"),A};function RA(A,e,t=window.document.head){if(A.length===0)return e.map(c=>{let I=M(c);return t.appendChild(c),I});let Q=A.map(W),o=e.map(W),B=V(Q,o,U),E=A.length,i=e.length,s=[],C=A[E-1],g=0,r=0;for(let c of B){let I=A[g],l=e[r],n=Q[g],f=o[r];g<E&&U(n,c)?(r<i&&U(f,c)&&(s.push(M(I)),r++),g++):(s.push(M(l)),g<E?I.before(l):(C.after(l),C=l),r++)}return s}var K=new WeakMap,M=A=>{if(K.has(A))return K.get(A);if(window.document.contains(A)&&A.media!=="preload"){let t=Promise.resolve(A);return K.set(A,t),t}if(A.hasAttribute("media")&&A.media!=="all"&&(A.dataset.originalMedia=A.media),A.media="preload",A instanceof HTMLStyleElement){let t=Promise.resolve(A);return K.set(A,t),t}let e=new Promise((t,Q)=>{A.addEventListener("load",()=>t(A)),A.addEventListener("error",o=>{let{href:B}=o.target;Q(Error(`The style sheet with the following URL failed to load: ${B}`))})});return K.set(A,e),e},z=A=>{let e=Array.from(window.document.querySelectorAll("style,link[rel=stylesheet]")),t=Array.from(A.querySelectorAll("style,link[rel=stylesheet]"));return RA(e,t)},_=A=>{window.document.querySelectorAll("style,link[rel=stylesheet]").forEach(e=>{if(e.sheet)if(A.includes(e)){if(e.sheet.media.mediaText==="preload"){let{originalMedia:t="all"}=e.dataset;e.sheet.media.mediaText=t}e.sheet.disabled=!1}else e.sheet.disabled=!0})};var SA=/\\/g;function UA(A){if(A.indexOf(":")===-1)return!1;try{return new URL(A),!0}catch{return!1}}function k(A,e){let t=e.indexOf("#"),Q=e.indexOf("?");if(t+Q>-2&&(e=e.slice(0,t===-1?Q:Q===-1||Q>t?t:Q)),A.indexOf("\\")!==-1&&(A=A.replace(SA,"/")),A[0]==="/"&&A[1]==="/")return e.slice(0,e.indexOf(":")+1)+A;if(A[0]==="."&&(A[1]==="/"||A[1]==="."&&(A[2]==="/"||A.length===2&&(A+="/"))||A.length===1&&(A+="/"))||A[0]==="/"){let o=e.slice(0,e.indexOf(":")+1),B;if(e[o.length+1]==="/"?o!=="file:"?(B=e.slice(o.length+2),B=B.slice(B.indexOf("/")+1)):B=e.slice(8):B=e.slice(o.length+(e[o.length]==="/")),A[0]==="/")return e.slice(0,e.length-B.length-1)+A;let E=B.slice(0,B.lastIndexOf("/")+1)+A,i=[],s=-1;for(let C=0;C<E.length;C++){if(s!==-1){E[C]==="/"&&(i.push(E.slice(s,C+1)),s=-1);continue}else if(E[C]==="."){if(E[C+1]==="."&&(E[C+2]==="/"||C+2===E.length)){i.pop(),C+=2;continue}else if(E[C+1]==="/"||C+1===E.length){C+=1;continue}}for(;E[C]==="/";)C++;s=C}return s!==-1&&i.push(E.slice(s)),e.slice(0,e.length-B.length)+i.join("")}}function MA(A,e){return k(A,e)||(UA(A)?A:k("./"+A,e))}function F(A,e){if(e[A])return A;let t=A.length;do{let Q=A.slice(0,t+1);if(Q in e)return Q}while((t=A.lastIndexOf("/",t-1))!==-1)}function AA(A,e){let t=F(A,e);if(t){let Q=e[t];return Q===null?void 0:Q+A.slice(t.length)}}function QA(A,e,t){let Q=t&&F(t,A.scopes);for(;Q;){let o=AA(e,A.scopes[Q]);if(o)return o;Q=F(Q.slice(0,Q.lastIndexOf("/")),A.scopes)}return AA(e,A.imports)||e.indexOf(":")!==-1&&e}function eA(A,e,t,Q){for(let o in A){let B=k(o,t)||o,E=A[o];if(typeof E!="string")continue;let i=QA(Q,k(E,t)||E,t);if(i){e[B]=i;continue}}}function FA(A,e,t){let Q={imports:Object.assign({},t.imports),scopes:Object.assign({},t.scopes)};if(A.imports&&eA(A.imports,Q.imports,e,t),A.scopes)for(let o in A.scopes){let B=MA(o,e);eA(A.scopes[o],Q.scopes[B]||(Q.scopes[B]={}),e,t)}return Q}var G={imports:{},scopes:{}},GA=document.baseURI,YA=GA;function tA(A){G=FA(A,YA,G)}function D(A,e){let t=k(A,e);return QA(G,t||A,e)||A}var oA;(function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase"})(oA||(oA={}));var qA=new Uint8Array(new Uint16Array([1]).buffer)[0]===1;function q(A,e="@"){if(!a)return x.then((()=>q(A)));let t=A.length+1,Q=(a.__heap_base.value||a.__heap_base)+4*t-a.memory.buffer.byteLength;Q>0&&a.memory.grow(Math.ceil(Q/65536));let o=a.sa(t-1);if((qA?HA:xA)(A,new Uint16Array(a.memory.buffer,o,t)),!a.parse())throw Object.assign(new Error(`Parse error ${e}:${A.slice(0,a.e()).split(`
|
||||
`).length}:${a.e()-A.lastIndexOf(`
|
||||
`,a.e()-1)}`),{idx:a.e()});let B=[],E=[];for(;a.ri();){let s=a.is(),C=a.ie(),g=a.it(),r=a.ai(),c=a.id(),I=a.ss(),l=a.se(),n;a.ip()&&(n=i(A.slice(c===-1?s-1:s,c===-1?C+1:C))),B.push({n,t:g,s,e:C,ss:I,se:l,d:c,a:r})}for(;a.re();){let s=a.es(),C=a.ee(),g=a.els(),r=a.ele(),c=A.slice(s,C),I=c[0],l=g<0?void 0:A.slice(g,r),n=l?l[0]:"";E.push({s,e:C,ls:g,le:r,n:I==='"'||I==="'"?i(c):c,ln:n==='"'||n==="'"?i(l):l})}function i(s){try{return(0,eval)(s)}catch{}}return[B,E,!!a.f(),!!a.ms()]}function xA(A,e){let t=A.length,Q=0;for(;Q<t;){let o=A.charCodeAt(Q);e[Q++]=(255&o)<<8|o>>>8}}function HA(A,e){let t=A.length,Q=0;for(;Q<t;)e[Q]=A.charCodeAt(Q++)}var a,x=WebAssembly.compile((Y="AGFzbQEAAAABKwhgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gA39/fwADMTAAAQECAgICAgICAgICAgICAgICAgIAAwMDBAQAAAUAAAAAAAMDAwAGAAAABwAGAgUEBQFwAQEBBQMBAAEGDwJ/AUHA8gALfwBBwPIACwd6FQZtZW1vcnkCAAJzYQAAAWUAAwJpcwAEAmllAAUCc3MABgJzZQAHAml0AAgCYWkACQJpZAAKAmlwAAsCZXMADAJlZQANA2VscwAOA2VsZQAPAnJpABACcmUAEQFmABICbXMAEwVwYXJzZQAUC19faGVhcF9iYXNlAwEKm0EwaAEBf0EAIAA2AoAKQQAoAtwJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgKECkEAIAA2AogKQQBBADYC4AlBAEEANgLwCUEAQQA2AugJQQBBADYC5AlBAEEANgL4CUEAQQA2AuwJIAEL0wEBA39BACgC8AkhBEEAQQAoAogKIgU2AvAJQQAgBDYC9AlBACAFQSRqNgKICiAEQSBqQeAJIAQbIAU2AgBBACgC1AkhBEEAKALQCSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGIgAbIAQgA0YiBBs2AgwgBSADNgIUIAVBADYCECAFIAI2AgQgBUEANgIgIAVBA0EBQQIgABsgBBs2AhwgBUEAKALQCSADRiICOgAYAkACQCACDQBBACgC1AkgA0cNAQtBAEEBOgCMCgsLXgEBf0EAKAL4CSIEQRBqQeQJIAQbQQAoAogKIgQ2AgBBACAENgL4CUEAIARBFGo2AogKQQBBAToAjAogBEEANgIQIAQgAzYCDCAEIAI2AgggBCABNgIEIAQgADYCAAsIAEEAKAKQCgsVAEEAKALoCSgCAEEAKALcCWtBAXULHgEBf0EAKALoCSgCBCIAQQAoAtwJa0EBdUF/IAAbCxUAQQAoAugJKAIIQQAoAtwJa0EBdQseAQF/QQAoAugJKAIMIgBBACgC3AlrQQF1QX8gABsLCwBBACgC6AkoAhwLHgEBf0EAKALoCSgCECIAQQAoAtwJa0EBdUF/IAAbCzsBAX8CQEEAKALoCSgCFCIAQQAoAtAJRw0AQX8PCwJAIABBACgC1AlHDQBBfg8LIABBACgC3AlrQQF1CwsAQQAoAugJLQAYCxUAQQAoAuwJKAIAQQAoAtwJa0EBdQsVAEEAKALsCSgCBEEAKALcCWtBAXULHgEBf0EAKALsCSgCCCIAQQAoAtwJa0EBdUF/IAAbCx4BAX9BACgC7AkoAgwiAEEAKALcCWtBAXVBfyAAGwslAQF/QQBBACgC6AkiAEEgakHgCSAAGygCACIANgLoCSAAQQBHCyUBAX9BAEEAKALsCSIAQRBqQeQJIAAbKAIAIgA2AuwJIABBAEcLCABBAC0AlAoLCABBAC0AjAoL3Q0BBX8jAEGA0ABrIgAkAEEAQQE6AJQKQQBBACgC2Ak2ApwKQQBBACgC3AlBfmoiATYCsApBACABQQAoAoAKQQF0aiICNgK0CkEAQQA6AIwKQQBBADsBlgpBAEEAOwGYCkEAQQA6AKAKQQBBADYCkApBAEEAOgD8CUEAIABBgBBqNgKkCkEAIAA2AqgKQQBBADoArAoCQAJAAkACQANAQQAgAUECaiIDNgKwCiABIAJPDQECQCADLwEAIgJBd2pBBUkNAAJAAkACQAJAAkAgAkGbf2oOBQEICAgCAAsgAkEgRg0EIAJBL0YNAyACQTtGDQIMBwtBAC8BmAoNASADEBVFDQEgAUEEakGCCEEKEC8NARAWQQAtAJQKDQFBAEEAKAKwCiIBNgKcCgwHCyADEBVFDQAgAUEEakGMCEEKEC8NABAXC0EAQQAoArAKNgKcCgwBCwJAIAEvAQQiA0EqRg0AIANBL0cNBBAYDAELQQEQGQtBACgCtAohAkEAKAKwCiEBDAALC0EAIQIgAyEBQQAtAPwJDQIMAQtBACABNgKwCkEAQQA6AJQKCwNAQQAgAUECaiIDNgKwCgJAAkACQAJAAkACQAJAIAFBACgCtApPDQAgAy8BACICQXdqQQVJDQYCQAJAAkACQAJAAkACQAJAAkACQCACQWBqDgoQDwYPDw8PBQECAAsCQAJAAkACQCACQaB/ag4KCxISAxIBEhISAgALIAJBhX9qDgMFEQYJC0EALwGYCg0QIAMQFUUNECABQQRqQYIIQQoQLw0QEBYMEAsgAxAVRQ0PIAFBBGpBjAhBChAvDQ8QFwwPCyADEBVFDQ4gASkABELsgISDsI7AOVINDiABLwEMIgNBd2oiAUEXSw0MQQEgAXRBn4CABHFFDQwMDQtBAEEALwGYCiIBQQFqOwGYCkEAKAKkCiABQQN0aiIBQQE2AgAgAUEAKAKcCjYCBAwNC0EALwGYCiIDRQ0JQQAgA0F/aiIDOwGYCkEALwGWCiICRQ0MQQAoAqQKIANB//8DcUEDdGooAgBBBUcNDAJAIAJBAnRBACgCqApqQXxqKAIAIgMoAgQNACADQQAoApwKQQJqNgIEC0EAIAJBf2o7AZYKIAMgAUEEajYCDAwMCwJAQQAoApwKIgEvAQBBKUcNAEEAKALwCSIDRQ0AIAMoAgQgAUcNAEEAQQAoAvQJIgM2AvAJAkAgA0UNACADQQA2AiAMAQtBAEEANgLgCQtBAEEALwGYCiIDQQFqOwGYCkEAKAKkCiADQQN0aiIDQQZBAkEALQCsChs2AgAgAyABNgIEQQBBADoArAoMCwtBAC8BmAoiAUUNB0EAIAFBf2oiATsBmApBACgCpAogAUH//wNxQQN0aigCAEEERg0EDAoLQScQGgwJC0EiEBoMCAsgAkEvRw0HAkACQCABLwEEIgFBKkYNACABQS9HDQEQGAwKC0EBEBkMCQsCQAJAAkACQEEAKAKcCiIBLwEAIgMQG0UNAAJAAkAgA0FVag4EAAkBAwkLIAFBfmovAQBBK0YNAwwICyABQX5qLwEAQS1GDQIMBwsgA0EpRw0BQQAoAqQKQQAvAZgKIgJBA3RqKAIEEBxFDQIMBgsgAUF+ai8BAEFQakH//wNxQQpPDQULQQAvAZgKIQILAkACQCACQf//A3EiAkUNACADQeYARw0AQQAoAqQKIAJBf2pBA3RqIgQoAgBBAUcNACABQX5qLwEAQe8ARw0BIAQoAgRBlghBAxAdRQ0BDAULIANB/QBHDQBBACgCpAogAkEDdGoiAigCBBAeDQQgAigCAEEGRg0ECyABEB8NAyADRQ0DIANBL0ZBAC0AoApBAEdxDQMCQEEAKAL4CSICRQ0AIAEgAigCAEkNACABIAIoAgRNDQQLIAFBfmohAUEAKALcCSECAkADQCABQQJqIgQgAk0NAUEAIAE2ApwKIAEvAQAhAyABQX5qIgQhASADECBFDQALIARBAmohBAsCQCADQf//A3EQIUUNACAEQX5qIQECQANAIAFBAmoiAyACTQ0BQQAgATYCnAogAS8BACEDIAFBfmoiBCEBIAMQIQ0ACyAEQQJqIQMLIAMQIg0EC0EAQQE6AKAKDAcLQQAoAqQKQQAvAZgKIgFBA3QiA2pBACgCnAo2AgRBACABQQFqOwGYCkEAKAKkCiADakEDNgIACxAjDAULQQAtAPwJQQAvAZYKQQAvAZgKcnJFIQIMBwsQJEEAQQA6AKAKDAMLECVBACECDAULIANBoAFHDQELQQBBAToArAoLQQBBACgCsAo2ApwKC0EAKAKwCiEBDAALCyAAQYDQAGokACACCxoAAkBBACgC3AkgAEcNAEEBDwsgAEF+ahAmC/4KAQZ/QQBBACgCsAoiAEEMaiIBNgKwCkEAKAL4CSECQQEQKSEDAkACQAJAAkACQAJAAkACQAJAQQAoArAKIgQgAUcNACADEChFDQELAkACQAJAAkACQAJAAkAgA0EqRg0AIANB+wBHDQFBACAEQQJqNgKwCkEBECkhA0EAKAKwCiEEA0ACQAJAIANB//8DcSIDQSJGDQAgA0EnRg0AIAMQLBpBACgCsAohAwwBCyADEBpBAEEAKAKwCkECaiIDNgKwCgtBARApGgJAIAQgAxAtIgNBLEcNAEEAQQAoArAKQQJqNgKwCkEBECkhAwsgA0H9AEYNA0EAKAKwCiIFIARGDQ8gBSEEIAVBACgCtApNDQAMDwsLQQAgBEECajYCsApBARApGkEAKAKwCiIDIAMQLRoMAgtBAEEAOgCUCgJAAkACQAJAAkACQCADQZ9/ag4MAgsEAQsDCwsLCwsFAA
Line truncated
|
||||
//# sourceURL=${n.responseUrl}?cycle`))),i(r-1),B+=`/*${o.slice(r-1,I)}*/${iA(f)}`,!j&&n.shellUrl&&(B+=`;import*as m$_${C} from'${n.blobUrl}';import{u$_ as u$_${C}}from'${n.shellUrl}';u$_${C}(m$_${C})`,n.shellUrl=void 0),s=I}else{if(l===-2)throw Error("The import.meta property is not supported.");i(c),B+="wpInteractivityRouterImport(",g.push(I-1),s=r}A.shellUrl&&(B+=`
|
||||
;import{u$_}from'${A.shellUrl}';try{u$_({${Q.filter(r=>r.ln).map(({s:r,e:c,ln:I})=>`${o.slice(r,c)}:${I}`).join(",")}})}catch(_){};
|
||||
`),i(o.length)}let E=!1;B=B.replace(OA,(i,s,C)=>(E=!s,i.replace(C,()=>new URL(C,A.responseUrl).toString()))),E||(B+=`
|
||||
//# sourceURL=`+A.responseUrl),A.blobUrl=sA(B),A.source=void 0}var OA=/\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;function nA(A,e,t){let Q=h[A];if(Q)return Q;if(Q={url:A},h[A]){let o=0;for(;h[Q.url+ ++o];);Q.url+=o}return h[Q.url]=Q,Q.fetchPromise=(async()=>{let o;({responseUrl:Q.responseUrl,source:o}=await($A[A]||BA(A,e,t)));try{Q.analysis=q(o,Q.url)}catch(B){console.error(B),Q.analysis=[[],[],!1,!1]}return Q.source=o,Q})(),Q.linkPromise=Q.fetchPromise.then(async()=>{let o=e;Q.deps=(await Promise.all(Q.analysis[0].map(async({n:B,d:E})=>{if(E!==-1||!B)return;let i=D(B,Q.responseUrl||Q.url);return CA&&CA(i)?{blobUrl:i}:(o.integrity&&(o={...o,integrity:void 0}),nA(i,o,Q.responseUrl).fetchPromise)}))).filter(B=>B)}),Q}var rA=A=>import(A);async function P(A,e){await y;let t=nA(A,e,null),Q={};return await gA(t,Q),aA(t,Q),await Promise.resolve(),t}async function J(A){let e=await rA(A.blobUrl);return A.shellUrl&&(await rA(A.shellUrl)).u$_(e),e}async function cA(A,e){let t=await P(A,e);return J(t)}var XA=document.baseURI,IA=XA;Object.defineProperty(self,"wpInteractivityRouterImport",{value:TA,writable:!1,enumerable:!1,configurable:!1});async function TA(A){return await y,cA(D(A,IA),{credentials:"same-origin"})}async function lA(A,e){return tA(e),await y,P(D(A,IA),{credentials:"same-origin"})}var wA=new Set,pA=A=>{wA.add(A)},fA=A=>{let e=A.querySelector("script#wp-importmap[type=importmap]"),t=e?JSON.parse(e.text):{imports:{},scopes:{}};for(let o in m.imports)delete t.imports[o];return[...A.querySelectorAll("script[type=module][src][data-wp-router-options]")].filter(o=>{try{return JSON.parse(o.getAttribute("data-wp-router-options"))?.loadOnClientNavigation===!0}catch{return!1}}).map(o=>o.src).filter(o=>!wA.has(o)).map(o=>lA(o,t))},dA=A=>Promise.all(A.map(e=>J(e)));var{getRegionRootFragment:ZA,initialVdomPromise:VA,toVdom:WA,render:zA,parseServerData:_A,populateServerData:Ae,batch:T,routerRegions:b,h:ee,navigationSignal:Qe,sessionId:te,warn:De}=jA("I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress."),R="data-wp-router-region",$="data-wp-interactive",LA=`[${$}][${R}], [${$}] [${$}][${R}]`,p=new Map,N=A=>{let e=new URL(A,window.location.href);return e.pathname+e.search},NA=A=>{let e=A.getAttribute(R);try{let{id:t,attachTo:Q}=JSON.parse(e);return{id:t,attachTo:Q}}catch{return{id:e}}},oe=A=>{if(!A)return A;let e=A.props.priorityLevels,t=e.findIndex(o=>o.includes("router-region")),Q=t!==-1?e.slice(t+1):e;return Q.length>0?ee(A.type,{...A.props,priorityLevels:Q}):A.props.element},v=new WeakMap,O=new WeakMap,yA=new Set,Be=async(A,{html:e})=>{try{if(!e){let Q=await window.fetch(A);if(Q.status!==200)return!1;e=await Q.text()}let t=new window.DOMParser().parseFromString(e,"text/html");return await JA(A,t)}catch{return!1}},JA=async(A,e,{vdom:t}={})=>{e.querySelectorAll("noscript").forEach(C=>C.remove());let Q={},o={};e.querySelectorAll(LA).forEach(C=>{let{id:g,attachTo:r}=NA(C);C.parentElement.closest(`[${R}]`)?Q[g]=void 0:Q[g]=t?.has(C)?t.get(C):WA(C),r&&!yA.has(g)&&(o[g]=r)});let B=e.querySelector("title")?.innerText,E=_A(e),[i,s]=await Promise.all([Promise.all(z(e)),Promise.all(fA(e))]);return{regions:Q,regionsToAttach:o,styles:i,scriptModules:s,title:B,initialData:E,url:A}},vA=A=>{_(A.styles);let e={...A.regionsToAttach};T(()=>{Ae(A.initialData),Qe.value+=1,b.forEach(Q=>{Q.value=null});let t=new Set;for(let Q in e){let o=document.querySelector(e[Q]);v.has(o)||v.set(o,[]);let B=v.get(o);B.includes(Q)||(B.push(Q),t.add(o))}for(let Q in A.regions)b.has(Q)&&(b.get(Q).value=oe(A.regions[Q]));t.forEach(Q=>{let B=v.get(Q).map(i=>A.regions[i]);if(!O.has(Q)){let i=B.map(({props:s,type:C})=>{let g=typeof C=="function"?s.type:C,r=document.createElement(g);return Q.appendChild(r),r});O.set(Q,ZA(i))}let E=O.get(Q);zA(B,E)})}),A.title&&(document.title=A.title)},KA=A=>(window.location.assign(A),new Promise(()=>{}));window.addEventListener("popstate",async()=>{let A=N(window.location.href),e=p.has(A)&&await p.get(A);e?T(()=>{w.url=window.location.href,vA(e)}):window.location.reload()});document.querySelectorAll(LA).forEach(A=>{let{id:e,attachTo:t}=NA(A);t&&yA.add(e)});window.document.querySelectorAll("script[type=module][src]").forEach(({src:A})=>pA(A));(async()=>{let A=await VA;p.set(N(window.location.href),Promise.resolve(JA(N(window.location.href),document,{vdom:A})))})();var X="",kA=!1,L={loading:"Loading page, please wait.",loaded:"Page Loaded."},{state:DA}=mA("core/router/private",{state:{navigation:{hasStarted:!1,hasFinished:!1}}},{lock:!0}),{state:w,actions:Ee}=mA("core/router",{state:{get navigation(){return DA.navigation}},actions:{*navigate(A,e={}){let{clientNavigationDisabled:t}=uA();t&&(yield KA(A));let Q=N(A),{navigation:o}=DA,{loadingAnimation:B=!0,screenReaderAnnouncement:E=!0,timeout:i=1e4}=e;X=A,Ee.prefetch(Q,e);let s=new Promise(r=>setTimeout(r,i)),C=setTimeout(()=>{X===A&&(B&&(o.hasStarted=!0,o.hasFinished=!1),E&&hA("loading"))},
Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'efaa5193bbad9c60ffd1');
|
||||
@@ -0,0 +1 @@
|
||||
var me,m,jt,ft,V,Lt,Vt,zt,nt,$e,he,Kt,ct,it,ot,Jt,Me={},Be=[],Ar=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,We=Array.isArray;function B(e,t){for(var r in t)e[r]=t[r];return e}function ut(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function R(e,t,r){var n,o,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return ve(e,s,n,o,null)}function ve(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++jt,__i:-1,__u:0};return o==null&&m.vnode!=null&&m.vnode(i),i}function Fe(e){return e.children}function ae(e,t){this.props=e,this.context=t}function fe(e,t){if(t==null)return e.__?fe(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?fe(e):null}function Hr(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],o=[],i=B({},t);i.__v=t.__v+1,m.vnode&&m.vnode(i),lt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??fe(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,Zt(n,i,o),t.__e=t.__=null,i.__e!=r&&Qt(i)}}function Qt(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Qt(e)}function st(e){(!e.__d&&(e.__d=!0)&&V.push(e)&&!qe.__r++||Lt!=m.debounceRendering)&&((Lt=m.debounceRendering)||Vt)(qe)}function qe(){try{for(var e,t=1;V.length;)V.length>t&&V.sort(zt),e=V.shift(),t=V.length,Hr(e)}finally{V.length=qe.__r=0}}function Xt(e,t,r,n,o,i,s,f,u,c,l){var a,_,p,w,E,h,d,v=n&&n.__k||Be,I=t.length;for(u=jr(r,t,v,u,I),a=0;a<I;a++)(p=r.__k[a])!=null&&(_=p.__i!=-1&&v[p.__i]||Me,p.__i=a,h=lt(e,p,_,o,i,s,f,u,c,l),w=p.__e,p.ref&&_.ref!=p.ref&&(_.ref&&pt(_.ref,null,p),l.push(p.ref,p.__c||w,p)),E==null&&w!=null&&(E=w),(d=!!(4&p.__u))||_.__k===p.__k?(u=Yt(p,u,e,d),d&&_.__e&&(_.__e=null)):typeof p.type=="function"&&h!==void 0?u=h:w&&(u=w.nextSibling),p.__u&=-7);return r.__e=E,u}function jr(e,t,r,n,o){var i,s,f,u,c,l=r.length,a=l,_=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=ve(null,s,null,null,null):We(s)?s=e.__k[i]=ve(Fe,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=ve(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,u=i+_,s.__=e,s.__b=e.__b+1,f=null,(c=s.__i=Vr(s,r,u,a))!=-1&&(a--,(f=r[c])&&(f.__u|=2)),f==null||f.__v==null?(c==-1&&(o>l?_--:o<l&&_++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?_--:c==u+1?_++:(c>u?_--:_++,s.__u|=4))):e.__k[i]=null;if(a)for(i=0;i<l;i++)(f=r[i])!=null&&(2&f.__u)==0&&(f.__e==n&&(n=fe(f)),tr(f,f));return n}function Yt(e,t,r,n){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=Yt(o[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=fe(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Vr(e,t,r,n){var o,i,s,f=e.key,u=e.type,c=t[r],l=c!=null&&(2&c.__u)==0;if(c===null&&f==null||l&&f==c.key&&u==c.type)return r;if(n>(l?1:0)){for(o=r-1,i=r+1;o>=0||i<t.length;)if((c=t[s=o>=0?o--:i++])!=null&&(2&c.__u)==0&&f==c.key&&u==c.type)return s}return-1}function At(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Ar.test(t)?r:r+"px"}function Oe(e,t,r,n,o){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||At(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||At(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Kt,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r[he]=n[he]:(r[he]=ct,e.addEventListener(t,i?ot:it,i)):e.removeEventListener(t,i?ot:it,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Ht(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[$e]==null)t[$e]=ct++;else if(t[$e]<r[he])return;return r(m.event?m.event(t):t)}}}function lt(e,t,r,n,o,i,s,f,u,c){var l,a,_,p,w,E,h,d,v,I,C,b,U,oe,rt,M=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),i=[f=t.__e=r.__e]),(l=m.__b)&&l(t);e:if(typeof M=="function")try{if(d=t.props,v=M.prototype&&M.prototype.render,I=(l=M.contextType)&&n[l.__c],C=l?I?I.props.value:l.__:n,r.__c?h=(a=t.__c=r.__c).__=a.__E:(v?t.__c=a=new M(d,C):(t.__c=a=new ae(d,C),a.constructor=M,a.render=Kr),I&&I.suLine truncated
|
||||
+12078
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'e5fd3ae6d2c3b6e669da');
|
||||
@@ -0,0 +1,94 @@
|
||||
var w=class e{constructor(t,r){let o=" "+t,s,i=r&&r.loc;if(i&&i.start<=i.end){let u=i.lexer.input;s=i.start;let h=i.end;s===u.length?o+=" at end of input: ":o+=" at position "+(s+1)+": ";let x=u.slice(s,h).replace(/[^]/g,"$&\u0332"),A;s>15?A="\u2026"+u.slice(s-15,s):A=u.slice(0,s);let q;h+15<u.length?q=u.slice(h,h+15)+"\u2026":q=u.slice(h),o+=A+x+q}let l=new Error(o);return l.name="ParseError",l.__proto__=e.prototype,l.position=s,l}};w.prototype.__proto__=Error.prototype;var yr=function(e,t){return e===void 0?t:e},wr=/([A-Z])/g,vr=function(e){return e.replace(wr,"-$1").toLowerCase()},kr={"&":"&",">":">","<":"<",'"':""","'":"'"},Ar=/[&><"']/g;function Sr(e){return String(e).replace(Ar,t=>kr[t])}var me=function(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?me(e.body[0]):e:e.type==="font"?me(e.body):e},qr=function(e){let t=me(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},_r=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Tr=function(e){let t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Cr=function(e){return+e.toFixed(4)},N={deflt:yr,escape:Sr,hyphenate:vr,getBaseElem:me,isCharacterBox:qr,protocolFromUrl:Tr,round:Cr},pe=class{constructor(t){t=t||{},this.displayMode=N.deflt(t.displayMode,!1),this.annotate=N.deflt(t.annotate,!1),this.leqno=N.deflt(t.leqno,!1),this.throwOnError=N.deflt(t.throwOnError,!1),this.errorColor=N.deflt(t.errorColor,"#b22222"),this.macros=t.macros||{},this.wrap=N.deflt(t.wrap,"tex"),this.xml=N.deflt(t.xml,!1),this.colorIsTextColor=N.deflt(t.colorIsTextColor,!1),this.strict=N.deflt(t.strict,!1),this.trust=N.deflt(t.trust,!1),this.maxSize=t.maxSize===void 0?[1/0,1/0]:Array.isArray(t.maxSize)?t.maxSize:[1/0,1/0],this.maxExpand=Math.max(0,N.deflt(t.maxExpand,1e3))}isTrusted(t){if(t.url&&!t.protocol){let o=N.protocolFromUrl(t.url);if(o==null)return!1;t.protocol=o}return!!(typeof this.trust=="function"?this.trust(t):this.trust)}},Ut={},Ce={};function S({type:e,names:t,props:r,handler:o,mathmlBuilder:s}){let i={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:o};for(let l=0;l<t.length;++l)Ut[t[l]]=i;e&&s&&(Ce[e]=s)}function se({type:e,mathmlBuilder:t}){S({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},mathmlBuilder:t})}var fe=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},z=function(e){return e.type==="ordgroup"?e.body:[e]},ge=class{constructor(t){this.children=t,this.classes=[],this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){let t=document.createDocumentFragment();for(let r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){let t="";for(let r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t}toText(){let t=r=>r.toText();return this.children.map(t).join("")}},ue=function(e){return e.filter(t=>t).join(" ")},Dr=function(e,t){this.classes=e||[],this.attributes={},this.style=t||{}},Br=function(e){let t=document.createElement(e);t.className=ue(this.classes);for(let r in this.style)Object.prototype.hasOwnProperty.call(this.style,r)&&(t.style[r]=this.style[r]);for(let r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);for(let r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Nr=function(e){let t=`<${e}`;this.classes.length&&(t+=` class="${N.escape(ue(this.classes))}"`);let r="";for(let o in this.style)Object.prototype.hasOwnProperty.call(this.style,o)&&(r+=`${N.hyphenate(o)}:${this.style[o]};`);r&&(t+=` style="${r}"`);for(let o in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,o)&&(t+=` ${o}="${N.escape(this.attributes[o])}"`);t+=">";for(let o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+=`</${e}>`,t},De=class{constructor(t,r,o){Dr.call(this,t,o),this.children=r||[]}setAttribute(t,r){this.attributes[t]=r}toNode(){return Br.call(this,"span")}toMarkup(){return Nr.call(this,"span")}},Or=class{constructor(t){this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return N.escape(this.text)}},be=class{constructor(t,r,o){this.href=t,this.classes=r,this.children=o||[]}toNode(){let t=document.createElement("a");t.setAttribute("href",this.href),this.classes.length>0&&(t.className=ue(this.classes));for(let r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){let t=`<a href='${N.escape(this.href)}'`;this.classes.length>0&&(t+=` class="${N.escape(ue(this.classes))}"`),t+=">";for(let r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</a>",t}Line truncated
|
||||
"Apricot": "#ffb484",
|
||||
"Aquamarine": "#08b4bc",
|
||||
"Bittersweet": "#c84c14",
|
||||
"blue": "#0000FF",
|
||||
"Blue": "#303494",
|
||||
"BlueGreen": "#08b4bc",
|
||||
"BlueViolet": "#503c94",
|
||||
"BrickRed": "#b8341c",
|
||||
"brown": "#BF8040",
|
||||
"Brown": "#802404",
|
||||
"BurntOrange": "#f8941c",
|
||||
"CadetBlue": "#78749c",
|
||||
"CarnationPink": "#f884b4",
|
||||
"Cerulean": "#08a4e4",
|
||||
"CornflowerBlue": "#40ace4",
|
||||
"cyan": "#00FFFF",
|
||||
"Cyan": "#08acec",
|
||||
"Dandelion": "#ffbc44",
|
||||
"darkgray": "#404040",
|
||||
"DarkOrchid": "#a8548c",
|
||||
"Emerald": "#08ac9c",
|
||||
"ForestGreen": "#089c54",
|
||||
"Fuchsia": "#90348c",
|
||||
"Goldenrod": "#ffdc44",
|
||||
"gray": "#808080",
|
||||
"Gray": "#98949c",
|
||||
"green": "#00FF00",
|
||||
"Green": "#08a44c",
|
||||
"GreenYellow": "#e0e474",
|
||||
"JungleGreen": "#08ac9c",
|
||||
"Lavender": "#f89cc4",
|
||||
"lightgray": "#c0c0c0",
|
||||
"lime": "#BFFF00",
|
||||
"LimeGreen": "#90c43c",
|
||||
"magenta": "#FF00FF",
|
||||
"Magenta": "#f0048c",
|
||||
"Mahogany": "#b0341c",
|
||||
"Maroon": "#b03434",
|
||||
"Melon": "#f89c7c",
|
||||
"MidnightBlue": "#086494",
|
||||
"Mulberry": "#b03c94",
|
||||
"NavyBlue": "#086cbc",
|
||||
"olive": "#7F7F00",
|
||||
"OliveGreen": "#407c34",
|
||||
"orange": "#FF8000",
|
||||
"Orange": "#f8843c",
|
||||
"OrangeRed": "#f0145c",
|
||||
"Orchid": "#b074ac",
|
||||
"Peach": "#f8945c",
|
||||
"Periwinkle": "#8074bc",
|
||||
"PineGreen": "#088c74",
|
||||
"pink": "#ff7f7f",
|
||||
"Plum": "#98248c",
|
||||
"ProcessBlue": "#08b4ec",
|
||||
"purple": "#BF0040",
|
||||
"Purple": "#a0449c",
|
||||
"RawSienna": "#983c04",
|
||||
"red": "#ff0000",
|
||||
"Red": "#f01c24",
|
||||
"RedOrange": "#f86434",
|
||||
"RedViolet": "#a0246c",
|
||||
"Rhodamine": "#f0549c",
|
||||
"Royallue": "#0874bc",
|
||||
"RoyalPurple": "#683c9c",
|
||||
"RubineRed": "#f0047c",
|
||||
"Salmon": "#f8948c",
|
||||
"SeaGreen": "#30bc9c",
|
||||
"Sepia": "#701404",
|
||||
"SkyBlue": "#48c4dc",
|
||||
"SpringGreen": "#c8dc64",
|
||||
"Tan": "#e09c74",
|
||||
"teal": "#007F7F",
|
||||
"TealBlue": "#08acb4",
|
||||
"Thistle": "#d884b4",
|
||||
"Turquoise": "#08b4cc",
|
||||
"violet": "#800080",
|
||||
"Violet": "#60449c",
|
||||
"VioletRed": "#f054a4",
|
||||
"WildStrawberry": "#f0246c",
|
||||
"yellow": "#FFFF00",
|
||||
"Yellow": "#fff404",
|
||||
"YellowGreen": "#98cc6c",
|
||||
"YellowOrange": "#ffa41c"
|
||||
}`),ce=(e,t)=>{let r="";if(e==="HTML"){if(!nn.test(t))throw new w("Invalid HTML input.");r=t}else if(e==="RGB"){if(!an.test(t))throw new w("Invalid RGB input.");t.split(",").map(o=>{r+=yt(Number(o.trim()))})}else{if(!sn.test(t))throw new w("Invalid rbg input.");t.split(",").map(o=>{let s=Number(o.trim());if(s>1)throw new w("Color rgb input must be < 1.");r+=yt(Number((s*255).toFixed(0)))})}return r.charAt(0)!=="#"&&(r="#"+r),r},xe=(e,t,r)=>{let o=`\\\\color@${e}`;if(!on.exec(e))throw new w("Invalid color: '"+e+"'",r);return ln.test(e)?"#"+e:(e.charAt(0)==="#"||(t.has(o)?e=t.get(o).tokens[0].text:wt[e]&&(e=wt[e])),e)},Yt=(e,t)=>{let r=U(e.body,t.withColor(e.color));return r=r.map(o=>(o.style.color=e.color,o)),p.newDocumentFragment(r)};S({type:"color",names:["\\textcolor"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","original"]},handler({parser:e,token:t},r,o){let s=o[0]&&C(o[0],"raw").string,i="";if(s){let u=C(r[0],"raw").string;i=ce(s,u)}else i=xe(C(r[0],"raw").string,e.gullet.macros,t);let l=r[1];return{type:"color",mode:e.mode,color:i,isTextColor:!0,body:z(l)}},mathmlBuilder:Yt});S({type:"color",names:["\\color"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw"]},handler({parser:e,breakOnTokenText:t,token:r},o,s){let i=s[0]&&C(s[0],"raw").string,l="";if(i){let h=C(o[0],"raw").string;l=ce(i,h)}else l=xe(C(o[0],"raw").string,e.gullet.macros,r);let u=e.parseExpression(!0,t,!0);return{type:"color",mode:e.mode,color:l,isTextColor:!1,body:u}},mathmlBuilder:Yt});S({type:"color",names:["\\definecolor"],props:{numArgs:3,allowedInText:!0,argTypes:["raw","raw","raw"]},handler({parser:e,funcName:t,token:r},o){let s=C(o[0],"raw").string;if(!/^[A-Za-z]+$/.test(s))throw new w("Color name must be latin letters.",r);let i=C(o[1],"raw").string;if(!["HTML","RGB","rgb"].includes(i))throw new w("Color model must be HTML, RGB, or rgb.",r);let l=C(o[2],"raw").string,u=ce(i,l);return e.gullet.macros.set(`\\\\color@${s}`,{tokens:[{text:u}],numArgs:0}),{type:"internal",mode:e.mode}}});S({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler({parser:e},t,r){let o=e.gullet.future().text==="["?e.parseSizeGroup(!0):null,s=!e.settings.displayMode;return{type:"cr",mode:e.mode,newLine:s,size:o&&C(o,"size").value}},mathmlBuilder(e,t){let r=new p.MathNode("mo");if(e.newLine&&(r.setAttribute("linebreak","newline"),e.size)){let o=K(e.size,t);r.setAttribute("height",o.number+o.unit)}return r}});var Ve={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ne=e=>{let t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new w("Expected a control sequence",e);return t},un=e=>{let t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},Kt=(e,t,r,o)=>{let s=e.gullet.macros.get(r.text);s==null&&(r.noexpand=!0,s={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,s,o)};S({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler({parser:e,funcName:t}){e.consumeSpaces();let r=e.fetch();if(Ve[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=Ve[r.text]),C(e.parseFunction(),"internal");throw new w("Invalid token after macro prefix",r)}});S({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let r=e.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new w("Expected a control sequence",r);let s=0,i,l=[[]];for(;e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){i=e.gullet.future(),l[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new w(`Invalid argument number "${r.text}"`);if(parseInt(r.text)!==s+1)throw new w(`Argument number "${r.text}" out of order`);s++,l.push([])}else{if(r.text==="EOF")throw new w("Expected a macro definition");l[s].push(r.text)}let{tokens:u}=e.gullet.consumeArg();if(i&&u.unshift(i),t==="\\edef"||t==="\\xdef"){if(u=e.gullet.expandTokens(u),u.length>e.gullet.settings.maxExpand)throw new w("Too many expansions in an "+t);u.reverse()}return e.gullet.macros.set(o,{tokens:u,numArgs:s,delimiters:l},t===Ve[t]),{type:"internal",mode:e.mode}}});S({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let r=Ne(e.gullet.popToken());e.gullet.consumeSpaces();let o=un(e);return Kt(e,r,o,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});S({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e,funcName:t}){let r=Ne(e.gullet.popToken()),o=e.gullet.popToken(),s=e.gullet.popToken();return Kt(e,r,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gul
Line truncated
|
||||
{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`);c("\\incoh",`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
|
||||
{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`);c("\\standardstate","\\text{\\tiny\\char`\u29B5}");c("\\ce",function(e){return nr(e.consumeArgs(1)[0],"ce")});c("\\pu",function(e){return nr(e.consumeArgs(1)[0],"pu")});c("\\uniDash","{\\rule{0.672em}{0.06em}}");c("\\triDash","{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}");c("\\tripleDash","\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em");c("\\tripleDashOverLine","\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em");c("\\tripleDashOverDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");c("\\tripleDashBetweenDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");var nr=function(e,t){for(var r="",o=e.length&&e[e.length-1].loc.start,s=e.length-1;s>=0;s--)e[s].loc.start>o&&(r+=" ",o=e[s].loc.start),r+=e[s].text,o+=e[s].text.length;var i=M.go(y.go(r,t));return i},y={go:function(e,t){if(!e)return[];t===void 0&&(t="ce");var r="0",o={};o.parenthesisLevel=0,e=e.replace(/\n/g," "),e=e.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),e=e.replace(/[\u2026]/g,"...");for(var s,i=10,l=[];;){s!==e?(i=10,s=e):i--;var u=y.stateMachines[t],h=u.transitions[r]||u.transitions["*"];e:for(var x=0;x<h.length;x++){var A=y.patterns.match_(h[x].pattern,e);if(A){for(var q=h[x].task,b=0;b<q.action_.length;b++){var k;if(u.actions[q.action_[b].type_])k=u.actions[q.action_[b].type_](o,A.match_,q.action_[b].option);else if(y.actions[q.action_[b].type_])k=y.actions[q.action_[b].type_](o,A.match_,q.action_[b].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+q.action_[b].type_+")"];y.concatArray(l,k)}if(r=q.nextState||r,e.length>0){if(q.revisit||(e=A.remainder),!q.toContinue)break e}else return l}}if(i<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"(-)(9)^(-9)":function(e){var t=e.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t&&t[0]?{match_:t.splice(1),remainder:e.substr(t[0].length)}:null},"state of aggregation $":function(e){var t=y.patterns.findObserveGroups(e,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t&&t.remainder.match(/^($|[\s,;\)\]\}])/))return t;var r=e.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:e.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(e){return y.patterns.findObserveGroups(e,"^{","","","}")},"^($...$)":function(e){return y.patterns.findObserveGroups(e,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(e){return y.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(e){return y.patterns.findObserveGroups(e,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(e){return y.patterns.findObserveGroups(e,"_{","","","}")},"_($...$)":function(e){return y.patterns.findObserveGroups(e,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(e){return y.patterns.findObserveGroups(e,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(e){return y.p
Line truncated
|
||||
Try \\math${t.slice(1)}`,r);t=t.slice(1)}else t=t.slice(5);let s=o[0];return{type:"lap",mode:e.mode,alignment:t,body:s}},mathmlBuilder:(e,t)=>{let r;if(e.alignment==="llap"){let i=U(z(e.body),t),l=new p.MathNode("mphantom",i);r=new p.MathNode("mpadded",[l]),r.setAttribute("width","0px")}let o=O(e.body,t),s;if(e.alignment==="llap"?(o.style.position="absolute",o.style.right="0",o.style.bottom="0",s=new p.MathNode("mpadded",[r,o])):s=new p.MathNode("mpadded",[o]),e.alignment==="rlap")e.body.body.length>0&&e.body.body[0].type==="genfrac"&&s.setAttribute("lspace","0.16667em");else{let i=e.alignment==="llap"?"-1":"-0.5";s.setAttribute("lspace",i+"width"),e.alignment==="llap"?s.style.position="relative":(s.style.display="flex",s.style.justifyContent="center")}return s.setAttribute("width","0px"),s}});S({type:"ordgroup",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler({funcName:e,parser:t},r){let o=t.mode;t.switchMode("math");let s=e==="\\("?"\\)":"$",i=t.parseExpression(!1,s);return t.expect(s),t.switchMode(o),{type:"ordgroup",mode:t.mode,body:i}}});S({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new w(`Mismatched ${e.funcName}`,t)}});var wn=(e,t)=>{switch(t.level){case F.DISPLAY:return e.display;case F.TEXT:return e.text;case F.SCRIPT:return e.script;case F.SCRIPTSCRIPT:return e.scriptscript;default:return e.text}};S({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:({parser:e},t)=>({type:"mathchoice",mode:e.mode,display:z(t[0]),text:z(t[1]),script:z(t[2]),scriptscript:z(t[3])}),mathmlBuilder:(e,t)=>{let r=wn(e,t);return te(r,t)}});var vn=["text","textord","mathord","atom"],ne=e=>{let t=new p.MathNode("mspace");return t.setAttribute("width",e+"em"),t};function cr(e,t){let r,o=U(e.body,t);if(e.mclass==="minner")r=new p.MathNode("mpadded",o);else if(e.mclass==="mord")e.isCharacterBox||o[0].type==="mathord"?(r=o[0],r.type="mi",r.children.length===1&&r.children[0].text&&r.children[0].text==="\u2207"&&r.setAttribute("mathvariant","normal")):r=new p.MathNode("mi",o);else{r=new p.MathNode("mrow",o),e.mustPromote?(r=o[0],r.type="mo",e.isCharacterBox&&e.body[0].text&&/[A-Za-z]/.test(e.body[0].text)&&r.setAttribute("mathvariant","italic")):r=new p.MathNode("mrow",o);let s=t.level<2;r.type==="mrow"?s&&(e.mclass==="mbin"?(r.children.unshift(ne(.2222)),r.children.push(ne(.2222))):e.mclass==="mrel"?(r.children.unshift(ne(.2778)),r.children.push(ne(.2778))):e.mclass==="mpunct"?r.children.push(ne(.1667)):e.mclass==="minner"&&(r.children.unshift(ne(.0556)),r.children.push(ne(.0556)))):e.mclass==="mbin"?(r.attributes.lspace=s?"0.2222em":"0",r.attributes.rspace=s?"0.2222em":"0"):e.mclass==="mrel"?(r.attributes.lspace=s?"0.2778em":"0",r.attributes.rspace=s?"0.2778em":"0"):e.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace=s?"0.1667em":"0"):e.mclass==="mopen"||e.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):e.mclass==="minner"&&s&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em"),e.mclass==="mopen"||e.mclass==="mclose"||(delete r.attributes.stretchy,delete r.attributes.form)}return r}S({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler({parser:e,funcName:t},r){let o=r[0],s=N.isCharacterBox(o),i=!0,l={type:"mathord",text:"",mode:e.mode},u=o.body?o.body:[o];for(let h of u)if(vn.includes(h.type))I[e.mode][h.text]?l.text+=I[e.mode][h.text].replace:h.text?l.text+=h.text:h.body&&h.body.map(x=>{l.text+=x.text});else{i=!1;break}return{type:"mclass",mode:e.mode,mclass:"m"+t.slice(5),body:z(i?l:o),isCharacterBox:s,mustPromote:i}},mathmlBuilder:cr});var kn=e=>{let t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};S({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler({parser:e},t){return{type:"mclass",mode:e.mode,mclass:kn(t[0]),body:z(t[1]),isCharacterBox:N.isCharacterBox(t[1])}}});S({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler({parser:e,funcName:t},r){let o=r[1],s=r[0],i={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,stack:!0,suppressBaseShift:t!=="\\stackrel",body:z(o)};return{type:"supsub",mode:s.mode,base:i,sup:t==="\\underset"?null:s,sub:t==="\\underset"?s:null}},mathmlBuilder:cr});var _e=(e,t,r)=>{if(!e)return r;let o=O(e,t);return o.type==="mrow"&&o.children.length===0?r:o};S({type:"multiscript",names:["\\sideset","\\pres@cript"],props:{numArgs:3},handler({parser:e,funcName:t,token:r},o){if(o[2].body.length===0)throw new w(t+"cannot parse an empty base.");let s=o[2].body[0];if(e.settings.strict&&t==="\\sideset"&&!s.symbol)throw new w("The base of \\sideset must be a big operator. Try \\prescript.");if(o[0].body.length>0&&o[0].body[0].type!=="supsub"||o[1].body.length>0&&o[1].body[0].type!=="supsub")t
Line truncated
|
||||
]`,Xn="\\\\[a-zA-Z@]+",Yn="\\\\[^\uD800-\uDFFF]",Kn=`(${Xn})${pr}*`,Jn=`\\\\(
|
||||
|[ \r ]+
|
||||
?)[ \r ]*`,Ze="[\u0300-\u036F]",Pt=new RegExp(`${Ze}+$`),Qn=`(${pr}+)|${Jn}|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]${Ze}*|[\uD800-\uDBFF][\uDC00-\uDFFF]${Ze}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${Kn}|${Yn})`,Oe=class{constructor(t,r){this.input=t,this.settings=r,this.tokenRegex=new RegExp(Qn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){let t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new Z("EOF",new V(this,r,r));let o=this.tokenRegex.exec(t);if(o===null||o.index!==r)throw new w(`Unexpected character: '${t[r]}'`,new Z(t[r],new V(this,r,r+1)));let s=o[6]||o[3]||(o[2]?"\\ ":" ");if(this.catcodes[s]===14){let i=t.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);if(i===-1){if(this.tokenRegex.lastIndex=t.length,this.settings.strict)throw new w("% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode")}else this.tokenRegex.lastIndex=i+1;return this.lex()}return new Z(s,new V(this,r,this.tokenRegex.lastIndex))}},Xe=class{constructor(t={},r={}){this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new w("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");let t=this.undefStack.pop();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]===void 0?delete this.current[r]:this.current[r]=t[r])}has(t){return Object.prototype.hasOwnProperty.call(this.current,t)||Object.prototype.hasOwnProperty.call(this.builtins,t)}get(t){return Object.prototype.hasOwnProperty.call(this.current,t)?this.current[t]:this.builtins[t]}set(t,r,o=!1){if(o){for(let s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{let s=this.undefStack[this.undefStack.length-1];s&&!Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=this.current[t])}this.current[t]=r}},fr={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Ye=class{constructor(t,r,o){this.settings=r,this.expansionCount=0,this.feed(t),this.macros=new Xe(hn,r.macros),this.mode=o,this.stack=[]}feed(t){this.lexer=new Oe(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){let r,o,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:s,end:o}=this.consumeArg(["]"])}else({tokens:s,start:r,end:o}=this.consumeArg());return this.pushToken(new Z("EOF",o.loc)),this.pushTokens(s),r.range(o,"")}consumeSpaces(){for(;this.future().text===" ";)this.stack.pop()}consumeArg(t){let r=[],o=t&&t.length>0;o||this.consumeSpaces();let s=this.future(),i,l=0,u=0;do{if(i=this.popToken(),r.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new w("Extra }",i)}else if(i.text==="EOF")throw new w("Unexpected end of input in a macro argument, expected '"+(t&&o?t[u]:"}")+"'",i);if(t&&o)if((l===0||l===1&&t[u]==="{")&&i.text===t[u]){if(++u,u===t.length){r.splice(-u,u);break}}else u=0}while(l!==0||o);return s.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:s,end:i}}consumeArgs(t,r){if(r){if(r.length!==t+1)throw new w("The length of delimiters doesn't match the number of args!");let s=r[0];for(let i=0;i<s.length;i++){let l=this.popToken();if(s[i]!==l.text)throw new w("Use of the macro doesn't match its definition",l)}}let o=[];for(let s=0;s<t;s++)o.push(this.consumeArg(r&&r[s+1]).tokens);return o}expandOnce(t){let r=this.popToken(),o=r.text,s=r.noexpand?null:this._getExpansion(o);if(s==null||t&&s.unexpandable){if(t&&s==null&&o[0]==="\\"&&!this.isDefined(o))throw new w("Undefined control sequence: "+o);return this.pushToken(r),!1}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new w("Too many expansions: infinite loop or need to increase maxExpand setting");let i=s.tokens,l=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(let u=i.length-1;u>=0;--u){let h=i[u];if(h.text==="#"){if(u===0)throw new w("Incomplete placeholder at end of macro body",h);if(h=i[--u],h.text==="#")i.splice(u+1,1);else if(/^[1-9]$/.test(h.text))i.splice(u,2,...l[+h.text-1]);else throw new w("Not a valid argument number",h)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){let t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Z(t)]):void 0}expandTokens(t){let r=[],o=this.stack.length;for(this.pushTokens(t);this.stack.length>o;)if(this.expandOnce(!0)===!1){let s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),r.push(s)}return r}expandMacroAsText(t){let r=this.expandMacro(t);return r&&r.map(o=>o.text).join("")}_getExpansion(t){let r=this.macros.get(t);if(r==null)return r;if(t.length===1){let s=this.lexer.catcodes[t];if(s!=null&&s!==13)return}let o=typeof r=="function"?r(this):r;if(typeof o=="string"){let s=0;if(o.indexOf("#")!==-1){let x=o.replace(/##/g,"");for(;x.indexOf("#"+(s+1))!==-1;)++s}let i=new Oe(o,this.settings),l=[],u=i.lex();for(;u.text!=="EOF";)l.push(u),u=i.lex();return l.reverse(),{tokens:l,numArgs:s}}return o}isDefined(t){return this.macros.has(t)||Object.prototype.hasOwnProperty.call(oe,t)||Object.prototype.hasOwnProperty.call(I.math,t)||Object.prototype.hasOwnProperty.call(I.text,
Line truncated
|
||||
please report what input caused this bug`);return i=i.slice(1,-1),{type:"verb",mode:"text",body:i,star:l}}if(Object.prototype.hasOwnProperty.call(jt,r[0])&&this.mode==="math"&&!I[this.mode][r[0]]){if(this.settings.strict&&this.mode==="math")throw new w(`Accented Unicode text character "${r[0]}" used in math mode`,t);r=jt[r[0]]+r.slice(1)}let o=this.mode==="math"?Pt.exec(r):null;o&&(r=r.substring(0,o.index),r==="i"?r="\u0131":r==="j"&&(r="\u0237"));let s;if(I[this.mode][r]){let i=I[this.mode][r].group;i==="bin"&&eo.includes(this.prevAtomType)&&(i="open");let l=V.range(t),u;if(Object.prototype.hasOwnProperty.call(Lr,i)){let h=i;u={type:"atom",mode:this.mode,family:h,loc:l,text:r}}else{if(Rt[r]){this.consume();let h=this.fetch().text.charCodeAt(0),x=h===65025?"mathscr":"mathcal";return(h===65024||h===65025)&&this.consume(),{type:"font",mode:"math",font:x,body:{type:"mathord",mode:"math",loc:l,text:Rt[r]}}}u={type:i,mode:this.mode,loc:l,text:r}}s=u}else if(r.charCodeAt(0)>=128||Pt.exec(r)){if(this.settings.strict&&this.mode==="math")throw new w(`Unicode text character "${r[0]}" used in math mode`,t);s={type:"textord",mode:"text",loc:V.range(t),text:r}}else return null;if(this.consume(),o)for(let i=0;i<o[0].length;i++){let l=o[0][i];if(!Ge[l])throw new w(`Unknown accent ' ${l}'`,t);let u=Ge[l][this.mode]||Ge[l].text;if(!u)throw new w(`Accent ${l} unsupported in ${this.mode} mode`,t);s={type:"accent",mode:this.mode,loc:V.range(t),label:u,isStretchy:!1,base:s}}return s}},gr=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("Temml can only parse string typed expression");let r=new $e(e,t);delete r.gullet.macros.current["\\df@tag"];let o=r.parse();if(!(o.length>0&&o[0].type&&o[0].type==="array"&&o[0].addEqnNum)&&r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new w("\\tag works only in display mode");r.gullet.feed("\\df@tag"),o=[{type:"tag",mode:"text",body:o,tag:r.parse()}]}return o},ro=[2,2,3,3],Ke=class e{constructor(t){this.level=t.level,this.color=t.color,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontSize=t.fontSize||1,this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.maxSize=t.maxSize}extend(t){let r={level:this.level,color:this.color,font:this.font,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return new e(r)}withLevel(t){return this.extend({level:t})}incrementLevel(){return this.extend({level:Math.min(this.level+1,3)})}inSubOrSup(){return this.extend({level:ro[this.level]})}withColor(t){return this.extend({color:t})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withFontSize(t){return this.extend({fontSize:t})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}getColor(){return this.color}},no="0.10.34";function oo(e){let t={},r=0,o=document.getElementsByClassName("tml-eqn");for(let l of o)for(r+=1,l.setAttribute("id","tml-eqn-"+String(r));l.tagName!=="mtable";)if(l.getElementsByClassName("tml-label").length>0){let h=l.attributes.id.value;t[h]=String(r);break}else l=l.parentElement;let s=document.getElementsByClassName("tml-tageqn");for(let l of s)if(l.getElementsByClassName("tml-label").length>0){let h=l.getElementsByClassName("tml-tag");if(h.length>0){let x=l.attributes.id.value;t[x]=h[0].textContent}}[...e.getElementsByClassName("tml-ref")].forEach(l=>{let u=l.getAttribute("href"),h=t[u.slice(1)];l.className.indexOf("tml-eqref")===-1?(h=h.replace(/^\(/,""),h=h.replace(/\)$/,"")):(h.charAt(0)!=="("&&(h="("+h),h.slice(-1)!==")"&&(h=h+")"));let x=document.createElementNS("http://www.w3.org/1998/Math/MathML","mtext");x.appendChild(document.createTextNode(h));let A=document.createElementNS("http://www.w3.org/1998/Math/MathML","math");A.appendChild(x),l.appendChild(A)})}var br=function(e,t,r={}){t.textContent="";let o=t.tagName.toLowerCase()==="math";o&&(r.wrap="none");let s=it(e,r);o?(t.textContent="",s.children.forEach(i=>{t.appendChild(i.toNode())})):s.children.length>1?(t.textContent="",s.children.forEach(i=>{t.appendChild(i.toNode())})):t.appendChild(s.toNode())};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: Temml doesn't work in quirks mode. Make sure your website has a suitable doctype."),br=function(){throw new w("Temml doesn't work in quirks mode.")});var ao=function(e,t){return it(e,t).toMarkup()},so=function(e,t){let r=new pe(t);return gr(e,r)},io=function(e,t){let r=new pe(t);if(r.macros={},!(typeof e=="string"||e instanceof String))throw new TypeError("Temml can only parse string typed expression");let o=new $e(e,r,!0);return delete o.gullet.macros.current["\\df@tag"],o.parse()},lo=function(e,t,r){if(r.throwOnError||!(e instanceof w))throw e;let o=new De(["temml-error"],[
Line truncated
|
||||
`+e.toString())]);return o.style.color=r.errorColor,o.style.whiteSpace="pre-line",o},it=function(e,t){let r=new pe(t);try{let o=gr(e,r),s=new Ke({level:r.displayMode?F.DISPLAY:F.TEXT,maxSize:r.maxSize});return Wr(o,e,s,r)}catch(o){return lo(o,e,r)}},xr={version:no,render:br,renderToString:ao,postProcess:oo,ParseError:w,definePreamble:io,__parse:so,__renderToMathMLTree:it,__defineSymbol:n,__defineMacro:c};function ho(e,{displayMode:t=!0}={}){let r=xr.renderToString(e,{displayMode:t,annotate:!0,throwOnError:!0}),o=document.implementation.createHTMLDocument("");return o.body.innerHTML=r,o.body.querySelector("math")?.innerHTML??""}export{ho as default};
|
||||
@@ -0,0 +1,7 @@
|
||||
// packages/latex-to-mathml/build-module/loader.mjs
|
||||
function loader() {
|
||||
return import("@wordpress/latex-to-mathml");
|
||||
}
|
||||
export {
|
||||
loader as default
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array(), 'module_dependencies' => array(array('id' => '@wordpress/latex-to-mathml', 'import' => 'dynamic')), 'version' => '4f37456af539bd3d2351');
|
||||
@@ -0,0 +1 @@
|
||||
function r(){return import("@wordpress/latex-to-mathml")}export{r as default};
|
||||
+2612
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-private-apis', 'wp-style-engine'), 'version' => '30ab62f45bfe9f971ea0');
|
||||
@@ -0,0 +1,37 @@
|
||||
var We=Object.create;var Tt=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ye=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Xe.call(t,n)&&n!==o&&Tt(t,n,{get:()=>e[n],enumerable:!(r=De(e,n))||r.enumerable});return t};var h=(t,e,o)=>(o=t!=null?We(He(t)):{},Ye(e||!t||!t.__esModule?Tt(o,"default",{value:t,enumerable:!0}):o,t));var pt=P((Bo,Ct)=>{Ct.exports=window.wp.editor});var U=P((No,Vt)=>{Vt.exports=window.wp.coreData});var G=P((Wo,zt)=>{zt.exports=window.wp.data});var Lt=P((Do,Mt)=>{Mt.exports=window.wp.components});var B=P((Ko,Gt)=>{Gt.exports=window.wp.element});var dt=P((Jo,Wt)=>{Wt.exports=window.wp.styleEngine});var Jt=P((nr,Zt)=>{Zt.exports=window.wp.i18n});var ht=P((sr,qt)=>{qt.exports=window.wp.blocks});var $e=P((Fr,xe)=>{xe.exports=window.wp.privateApis});var It=P((Br,Re)=>{Re.exports=window.ReactJSXRuntime});var Me=P((Xr,ze)=>{ze.exports=window.wp.blockEditor});var Te=h(pt(),1),Pt=h(U(),1),jt=h(G(),1),Ce=h(Lt(),1),Ve=h(B(),1);var Ut=h(U(),1),Bt=h(G(),1);function ot({templateId:t}={}){let{globalStylesId:e,stylesId:o}=(0,Bt.useSelect)(r=>{let n=r(Ut.store),s=t?n.getEntityRecord("postType","wp_template",t):null;return{globalStylesId:n.__experimentalGetCurrentGlobalStylesId(),stylesId:s?.styles_id}},[t]);return o||e}function rt(t,e,o){e=Array.isArray(e)?[...e]:[e],t=Array.isArray(t)?[...t]:{...t};let r=e.pop(),n=t;for(let s of e){let i=n[s];n=n[s]=Array.isArray(i)?[...i]:{...i}}return n[r]=o,t}var S=(t,e,o)=>{let r=Array.isArray(e)?e:e.split("."),n=t;return r.forEach(s=>{n=n?.[s]}),n??o};var Ze=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode"];function Nt(t,e,o){let r=o?".blocks."+o:"",n=e?"."+e:"",s=`settings${r}${n}`,i=`settings${n}`;if(e)return S(t,s)??S(t,i);let a={};return Ze.forEach(l=>{let c=S(t,`settings${r}.${l}`)??S(t,`settings.${l}`);c!==void 0&&(a=rt(a,l.split("."),c))}),a}var Kt=h(dt(),1);var Je="1600px",qe="320px",Qe=1,to=.25,eo=.75,oo="14px";function Dt({minimumFontSize:t,maximumFontSize:e,fontSize:o,minimumViewportWidth:r=qe,maximumViewportWidth:n=Je,scaleFactor:s=Qe,minimumFontSizeLimit:i}){if(i=R(i)?i:oo,o){let b=R(o);if(!b?.unit||!b?.value)return null;let E=R(i,{coerceTo:b.unit});if(E?.value&&!t&&!e&&b?.value<=E?.value)return null;if(e||(e=`${b.value}${b.unit}`),!t){let M=b.unit==="px"?b.value:b.value*16,ut=Math.min(Math.max(1-.075*Math.log2(M),to),eo),D=H(b.value*ut,3);E?.value&&D<E?.value?t=`${E.value}${E.unit}`:t=`${D}${b.unit}`}}let a=R(t),l=a?.unit||"rem",c=R(e,{coerceTo:l});if(!a||!c)return null;let d=R(t,{coerceTo:"rem"}),f=R(n,{coerceTo:l}),p=R(r,{coerceTo:l});if(!f||!p||!d)return null;let g=f.value-p.value;if(!g)return null;let u=H(p.value/100,3),m=H(u,3)+l,v=100*((c.value-a.value)/g),y=H((v||1)*s,3),O=`${d.value}${d.unit} + ((1vw - ${m}) * ${y})`;return`clamp(${t}, ${O}, ${e})`}function R(t,e={}){if(typeof t!="string"&&typeof t!="number")return null;isFinite(t)&&(t=`${t}px`);let{coerceTo:o,rootSizeValue:r,acceptableUnits:n}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...e},s=n?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${s}){1,1}$`),a=t.toString().match(i);if(!a||a.length<3)return null;let[,l,c]=a,d=parseFloat(l);return o==="px"&&(c==="em"||c==="rem")&&(d=d*r,c=o),c==="px"&&(o==="em"||o==="rem")&&(d=d/r,c=o),(o==="em"||o==="rem")&&(c==="em"||c==="rem")&&(c=o),c?{value:H(d,3),unit:c}:null}function H(t,e=3){let o=Math.pow(10,e);return Math.round(t*o)/o}function gt(t){let e=t?.fluid;return e===!0||e&&typeof e=="object"&&ObjecLine truncated
|
||||
<svg
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 0 0"
|
||||
width="0"
|
||||
height="0"
|
||||
focusable="false"
|
||||
role="none"
|
||||
aria-hidden="true"
|
||||
style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"
|
||||
>
|
||||
<defs>
|
||||
<filter id="${t}">
|
||||
<!--
|
||||
Use sRGB instead of linearRGB so transparency looks correct.
|
||||
Use perceptual brightness to convert to grayscale.
|
||||
-->
|
||||
<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>
|
||||
<!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. -->
|
||||
<feComponentTransfer color-interpolation-filters="sRGB">
|
||||
<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>
|
||||
<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>
|
||||
<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>
|
||||
<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>
|
||||
</feComponentTransfer>
|
||||
<!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. -->
|
||||
<feComposite in2="SourceGraphic" operator="in"></feComposite>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>`}function V(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function vt(t){if(!t)return;let e=t.match(/var:preset\|spacing\|(.+)/);return e?`var(--wp--preset--spacing--${e[1]})`:t}function mo(t){if(!t)return null;let e=typeof t=="string";return{top:e?t:t?.top,left:e?t:t?.left}}function wt(t,e="0"){let o=mo(t);if(!o)return null;let r=vt(o?.top)||e,n=vt(o?.left)||e;return r===n?r:`${r} ${n}`}var fe={backgroundSize:"cover",backgroundPosition:"50% 50%"};function pe(t){if(!t||!t?.backgroundImage?.url)return;let e;return t?.backgroundSize||(e={backgroundSize:fe.backgroundSize}),t?.backgroundSize==="contain"&&!t?.backgroundPosition&&(e={backgroundPosition:fe.backgroundPosition}),e}var de={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}};var ho={button:"wp-element-button",caption:"wp-element-caption"},yo={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function bo(t={},e){return Y.reduce((o,{path:r,valueKey:n,valueFunc:s,cssVarInfix:i})=>{let a=S(t,r,[]);return["default","theme","custom"].forEach(l=>{a[l]&&a[l].forEach(c=>{n&&!s?o.push(`--wp--preset--${i}--${V(c.slug)}: ${c[n]}`):s&&typeof s=="function"&&o.push(`--wp--preset--${i}--${V(c.slug)}: ${s(c,e)}`)})}),o},[])}function So(t="*",e={}){return Y.reduce((o,{path:r,cssVarInfix:n,classes:s})=>{if(!s)return o;let i=S(e,r,[]);return["default","theme","custom"].forEach(a=>{i[a]&&i[a].forEach(({slug:l})=>{s.forEach(({classSuffix:c,propertyName:d})=>{let f=`.has-${V(l)}-${c}`,p=t.split(",").map(u=>`${u}${f}`).join(","),g=`var(--wp--preset--${n}--${V(l)})`;o+=`${p}{${d}: ${g} !important;}`})})}),o},"")}function vo(t={}){return Y.filter(e=>e.path.at(-1)==="duotone").flatMap(e=>{let o=S(t,e.path,{});return["default","theme"].filter(r=>o[r]).flatMap(r=>o[r].map(n=>ue(`wp-duotone-${n.slug}`,n.colors))).join("")})}function be(t={},e,o){let r=[];return Object.keys(t).forEach(n=>{let s=e+V(n.replace("/","-")),i=t[n];if(i instanceof Object){let a=s+o;r=[...r,...be(i,a,o)]}else r.push(`${s}: ${i}`)}),r}function wo(t,e){let o=t.split(","),r=[];return o.forEach(n=>{r.push(`${e.trim()}${n.trim()}`)}),r.join(", ")}var ge=(t,e,o)=>{if(o!=="core/paragraph"||(e?.blocks?.["core/paragraph"]?.typography?.textIndent??e?.typography?.textIndent??"subsequent")!=="all")return t;let s=".wp-block-paragraph + .wp-block-paragraph",i=".wp-block-paragraph";if(s in t){let a=t[s],l={...t};return delete l[s],l[i]=a,l}return t},me=(t,e)=>{let o={};return Object.entries(t).forEach(([r,n])=>{if(r==="root"||!e?.[r])return;let s=typeof n=="string";if(!s&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([i,a])=>{if(i==="root"||!e?.[r][i])return;let l={[r]:{[i]:e[r][i]}},c=W(l);o[a]=[...o[a]||[],...c],delete e[r][i]}),s||typeof n=="object"&&n!==null&&"root"in n){let i=s?n:n.root,a={[r]:e[r]},l=W(a);o[i]=[...o[i]||[],...l],delete e[r]}}),o};function W(t={},e="",o,r={},n=!1){let s=T===e,i=Object.entries(x.__EXPERIMENTAL_STYLE_PROPERTY).reduce((l,[c,{value:d,properties:f,useEngine:p,Line truncated
|
||||
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
|
||||
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
|
||||
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
|
||||
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
|
||||
`),u+="}"),a.blockStyles&&l.forEach(({selector:m,duotoneSelector:v,styles:y,fallbackGapValue:O,hasLayoutSupport:b,featureSelectors:E,styleVariationSelectors:M,skipSelectorWrapper:ut,name:D})=>{if(E){let $=me(E,y);$=ge($,t.settings,D),Object.entries($).forEach(([k,_])=>{if(_.length){let K=_.join(";");u+=`:root :where(${k}){${K};}`}})}if(v){let $={};y?.filter&&($.filter=y.filter,delete y.filter);let k=W($);k.length&&(u+=`${v}{${k.join(";")};}`)}!n&&(T===m||b)&&(u+=he({style:y,selector:m,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:O}));let At=W(y,m,d,t,s);if(At?.length){let $=ut?m:`:root :where(${m})`;u+=`${$}{${At.join(";")};}`}y?.css&&(u+=Et(y.css,`:root :where(${m})`)),a.variationStyles&&M&&Object.entries(M).forEach(([$,k])=>{let _=y?.variations?.[$];if(_){if(E){let L=me(E,_);L=ge(L,t.settings,D),Object.entries(L).forEach(([ft,Rt])=>{if(Rt.length){let Be=wo(ft,k),Ne=Rt.join(";");u+=`:root :where(${Be}){${Ne};}`}})}let K=W(_,k,d,t);if(K.length&&(u+=`:root :where(${k}){${K.join(";")};}`),_?.css&&(u+=Et(_.css,`:root :where(${k})`)),b&&_?.spacing?.blockGap){let L=k+m;u+=he({style:_,selector:L,hasBlockGapSupport:!0,hasFallbackGapSupport:r,fallbackGapValue:O})}}});let Ft=Object.entries(y).filter(([$])=>$.startsWith(":"));Ft?.length&&Ft.forEach(([$,k])=>{let _=W(k);if(!_?.length)return;let L=`:root :where(${m.split(",").map(ft=>ft+$).join(",")}){${_.join(";")};}`;u+=L})}),a.layoutStyles&&(u=u+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",u=u+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",u=u+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let m=wt(t?.styles?.spacing?.blockGap)||"0.5em";u=u+`:root :where(.wp-site-blocks) > * { margin-block-start: ${m}; margin-block-end: 0; }`,u=u+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",u=u+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&c.forEach(({selector:m,presets:v})=>{(T===m||X===m)&&(m="");let y=So(m,v);y.length>0&&(u+=y)}),u};function Oo(t,e){return xt(t,e).flatMap(({presets:r})=>vo(r))}var ko=(t,e)=>{if(t?.selectors&&Object.keys(t.selectors).length>0)return t.selectors;let o={root:e};return Object.entries(yo).forEach(([r,n])=>{let s=N(t,r);s&&(o[n]=s)}),o},Io=(t,e)=>{let{getBlockStyles:o}=(0,ye.select)(x.store),r={};return t.forEach(n=>{let s=n.name,i=N(n);if(!i)return;let a=N(n,"filter.duotone");if(!a){let g=N(n),u=(0,x.getBlockSupport)(n,"color.__experimentalDuotone",!1);a=u&&g&&j(g,u)}let l=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,c=n?.supports?.spacing?.blockGap?.__experimentalDefault,d=o(s),f={};d?.forEach(g=>{let u=e?`-${e}`:"",m=`${g.name}${u}`,v=Yt(m,i);f[m]=v});let p=ko(n,i);r[s]={duotoneSelector:a??void 0,fallbackGapValue:c,featureSelectors:Object.keys(p).length?p:void 0,hasLayoutSupport:l,name:s,selector:i,styleVariationSelectors:d?.length?f:void 0}}),r};function Po(t){let e=t.styles?.blocks,o=e?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...t,styles:{...t.styles,blocks:{...e,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:t}function Et(t,e){let o="";return!t||t.trim()===""||t.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${e}){${n.trim()}}`;else{let i=n.replace("}","").split("{");if(i.length!==2)return;let[a,l]=i,c=a.match(/([>+~\s]*::[a-zA-Z-]+)/),d=c?c[1]:"",f=c?a.replace(d,"").trim():a.trim(),p;f===""?p=e:p=a.startsWith(" ")?j(e,f):Xt(e,f),o+=`:root :where(${p})${d}{${l.trim()}}`}}),o}function $t(t={},e=[],o={}){let{hasBlockGapSupport:r,hasFallbackGapSupport:n,disableLayoutStyles:s=!1,disableRootPadding:i=!1,styleOptions:a={}}=o,l=e.length>0?e:(0,x.getBlockTypes)(),c=Nt(t,"spacing.blockGap"),d=r??c!==null,f=n??!d;if(!t?.styles||!t?.settings)return[[],{}];let p=Po(t),g=Io(l),u=$o(p,g),m=_o(p,g,d,f,s,i,a),v=Oo(p,g),y=[{css:u,isGlobalStyles:!0},{css:m,isGlobalStyles:!0},{css:p?.styles?.css??"",isGlobalStyles:!0},{assets:v,__unstableType:"svg",isGlobalStyles:!0}];return l.forEach(O=>{let b=p?.styles?.blocks?.[O.name];if(b?.css){let E=g[O.name].selector;y.push({css:Et(b.css,E),isGlobalStyles:!0})}}),[y,p.settings]}var Oe=h(U(),1),_t=h(B(),1),ke=h(G(),1);var Se=h(U(),1),ve=h(G(),1),we=h(B(),1);function Ee(t){let{userGlobalStyles:e}=(0,ve.useSelect)(o=>{let{getEntityRecord:r,getEditedEntityRecord:n,canUser:s}=o(Se.store),i=s("update",{kind:"root",name:"globalStyles",id:t}),a;return typeof i=="boolean"&&(i?a=n("root","globalStyles",t):a=r("root","globalStyles",t,{context:"view"})),{userGlobalStyles:a}},[t]);return(0,we.useMemo)(()=>e?{user:e}:{user:void 0},[e])}var _e=h($e(),1),{unlock:F}=(0,_e.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/lazy-editor");function at({stylesId:t}){let{editorSettings:e
Line truncated
|
||||
`):typeof e=="string"&&(r=e),r&&r.trim()){let n=t+"-"+o+"-inline-css";if(!document.getElementById(n)){let s=document.createElement("style");s.id=n,s.textContent=r.trim(),document.head.appendChild(s)}}}function Pe(t,e,o){let r=e;Array.isArray(r)&&(r=r.join(`
|
||||
`));let n=document.createElement("script");return n.id=t+"-"+o+"-js",n.textContent=r.trim(),n}function je(t){let e=new Set,o=new Set,r=[];function n(s){if(!e.has(s)){if(o.has(s)){console.warn(`Circular dependency detected for handle: ${s}`);return}o.add(s),t[s]&&(t[s].deps||[]).forEach(a=>{t[a]&&n(a)}),o.delete(s),e.add(s),t[s]&&r.push(s)}}return Object.keys(t).forEach(s=>{n(s)}),r}async function Ro(t,e){let o=[];for(let r of t){if(r.src){let n=Promise.withResolvers();r.onload=()=>n.resolve(),r.onerror=()=>{console.error(`Failed to load script: ${r.id}`),n.resolve()},o.push(n.promise)}else await Promise.all(o),o=[];e.appendChild(r)}await Promise.all(o),o=[]}async function To(t,e,o,r,n,s){s&&jo(s);let i=je(o),a=je(t),l=[];for(let f of i){let p=r.before?.[f];p&&Ie(f,p,"before"),l.push(Ao(f,o[f]));let g=r.after?.[f];g&&Ie(f,g,"after")}let c=[];for(let f of a){let p=e.before?.[f];p&&c.push(Pe(f,p,"before")),c.push(Fo(f,t[f]));let g=e.after?.[f];g&&c.push(Pe(f,g,"after"))}let d=Ro(c,document.body);await Promise.all([Promise.all(l),d]),n&&n.length>0&&n.forEach(f=>{let p=f.match(/<script([^>]*)>(.*?)<\/script>/is);if(p){let g=p[1],u=p[2],m=document.createElement("script"),v=g.match(/id=["']([^"']+)["']/);v&&(m.id=v[1]);let y=g.match(/type=["']([^"']+)["']/);y&&(m.type=y[1]),m.textContent=u,document.body.appendChild(m)}})}var Ae=To;var kt=h(U(),1),lt=h(B(),1),ct=h(G(),1);var Ot;async function Fe(){return Ot||(Ot=(async()=>{let e=await F((0,ct.resolveSelect)(kt.store)).getEditorAssets();await Ae(e.scripts||{},e.inline_scripts||{before:{},after:{}},e.styles||{},e.inline_styles||{before:{},after:{}},e.html_templates||[],e.script_modules||{})})()),Ot}function q(){let t=(0,ct.useSelect)(r=>F(r(kt.store)).getEditorAssets(),[]),[e,o]=(0,lt.useState)(!1);return(0,lt.useEffect)(()=>{t&&!e&&Fe().then(()=>{o(!0)}).catch(r=>{console.error("Failed to load editor assets:",r)})},[t,e]),{isReady:!!t&&e,assetsLoaded:e}}var Q=h(It(),1),{Editor:Co,BackButton:Vo}=F(Te.privateApis);function zo({postType:t,postId:e,settings:o,backButton:r}){let n=(0,jt.useSelect)(g=>{if(t||e)return null;let{getHomePage:u}=F(g(Pt.store));return u()},[t,e]),s=t||n?.postType,i=e||n?.postId,a=(0,jt.useSelect)(g=>{if(!(!s||!i))return s==="wp_template"?i:F(g(Pt.store)).getTemplateId(s,i)},[s,i]),l=ot({templateId:a}),{isReady:c,editorSettings:d}=at({stylesId:l}),{isReady:f}=q(),p=(0,Ve.useMemo)(()=>({...d,...o}),[d,o]);return!c||!f?(0,Q.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,Q.jsx)(Ce.Spinner,{})}):(0,Q.jsx)(Co,{postType:s,postId:i,templateId:a,settings:p,styles:p.styles,children:r&&(0,Q.jsx)(Vo,{children:r})})}var Le=h(Jt(),1),et=h(B(),1),tt=h(Me(),1),Ge=h(pt(),1),Ue=h(ht(),1);var z=h(It(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='5619aa31a1']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","5619aa31a1"),t.appendChild(document.createTextNode(".lazy-editor-block-preview__container{align-items:center;border-radius:4px;display:flex;flex-direction:column;height:100%;justify-content:center}.dataviews-view-grid .lazy-editor-block-preview__container .block-editor-block-preview__container{height:100%}.dataviews-view-table .lazy-editor-block-preview__container{text-wrap:balance;text-wrap:pretty;flex-grow:0;width:96px}")),document.head.appendChild(t)}var{useStyle:Mo}=F(Ge.privateApis);function Lo({blocks:t,content:e,description:o}){let r=(0,et.useId)(),n=Mo("color.background"),s=(0,et.useMemo)(()=>t??(0,Ue.parse)(e,{__unstableSkipMigrationLogs:!0}),[e,t]),i=!s?.length;return(0,z.jsxs)("div",{className:"lazy-editor-block-preview__container",style:{backgroundColor:n},"aria-describedby":o?r:void 0,children:[i&&(0,Le.__)("Empty."),!i&&(0,z.jsx)(tt.BlockPreview.Async,{children:(0,z.jsx)(tt.BlockPreview,{blocks:s})}),!!o&&(0,z.jsx)("div",{hidden:!0,id:r,children:o})]})}function Go({blocks:t,content:e,description:o}){let r=ot(),{isReady:n,editorSettings:s}=at({stylesId:r}),{isReady:i}=q(),a=(0,et.useMemo)(()=>({...s,isPreviewMode:!0}),[s]);return!n||!i?null:(0,z.jsx)(tt.BlockEditorProvider,{settings:a,children:(0,z.jsx)(Lo,{blocks:t,content:e,description:o})})}export{zo as Editor,Go as Preview,Fe as loadEditorAssets,q as useEditorAssets};
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/**
|
||||
* Script module registry - Auto-generated by build process.
|
||||
* Do not edit this file manually.
|
||||
*
|
||||
* @package wp
|
||||
*/
|
||||
|
||||
return array(
|
||||
array(
|
||||
'id' => '@wordpress/a11y',
|
||||
'path' => 'a11y/index',
|
||||
'asset' => 'a11y/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/abilities',
|
||||
'path' => 'abilities/index',
|
||||
'asset' => 'abilities/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-editor/utils/fit-text-frontend',
|
||||
'path' => 'block-editor/utils/fit-text-frontend',
|
||||
'asset' => 'block-editor/utils/fit-text-frontend.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/accordion/view',
|
||||
'path' => 'block-library/accordion/view',
|
||||
'asset' => 'block-library/accordion/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/file/view',
|
||||
'path' => 'block-library/file/view',
|
||||
'asset' => 'block-library/file/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/form/view',
|
||||
'path' => 'block-library/form/view',
|
||||
'asset' => 'block-library/form/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/image/view',
|
||||
'path' => 'block-library/image/view',
|
||||
'asset' => 'block-library/image/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/navigation/view',
|
||||
'path' => 'block-library/navigation/view',
|
||||
'asset' => 'block-library/navigation/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/playlist/view',
|
||||
'path' => 'block-library/playlist/view',
|
||||
'asset' => 'block-library/playlist/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/query/view',
|
||||
'path' => 'block-library/query/view',
|
||||
'asset' => 'block-library/query/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/search/view',
|
||||
'path' => 'block-library/search/view',
|
||||
'asset' => 'block-library/search/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/block-library/tabs/view',
|
||||
'path' => 'block-library/tabs/view',
|
||||
'asset' => 'block-library/tabs/view.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/boot',
|
||||
'path' => 'boot/index',
|
||||
'asset' => 'boot/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/boot',
|
||||
'path' => 'boot/index',
|
||||
'asset' => 'boot/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/connectors',
|
||||
'path' => 'connectors/index',
|
||||
'asset' => 'connectors/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/core-abilities',
|
||||
'path' => 'core-abilities/index',
|
||||
'asset' => 'core-abilities/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/edit-site-init',
|
||||
'path' => 'edit-site-init/index',
|
||||
'asset' => 'edit-site-init/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity',
|
||||
'path' => 'interactivity/index',
|
||||
'asset' => 'interactivity/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity-router',
|
||||
'path' => 'interactivity-router/index',
|
||||
'asset' => 'interactivity-router/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/interactivity-router/full-page',
|
||||
'path' => 'interactivity-router/full-page',
|
||||
'asset' => 'interactivity-router/full-page.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/latex-to-mathml',
|
||||
'path' => 'latex-to-mathml/index',
|
||||
'asset' => 'latex-to-mathml/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/latex-to-mathml/loader',
|
||||
'path' => 'latex-to-mathml/loader',
|
||||
'asset' => 'latex-to-mathml/loader.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/lazy-editor',
|
||||
'path' => 'lazy-editor/index',
|
||||
'asset' => 'lazy-editor/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/route',
|
||||
'path' => 'route/index',
|
||||
'asset' => 'route/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/route',
|
||||
'path' => 'route/index',
|
||||
'asset' => 'route/index.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/vips/loader',
|
||||
'path' => 'vips/loader',
|
||||
'asset' => 'vips/loader.min.asset.php',
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/vips/worker',
|
||||
'path' => 'vips/worker',
|
||||
'asset' => 'vips/worker.min.asset.php',
|
||||
'min_only' => true,
|
||||
),
|
||||
array(
|
||||
'id' => '@wordpress/workflow',
|
||||
'path' => 'workflow/index',
|
||||
'asset' => 'workflow/index.min.asset.php',
|
||||
),
|
||||
);
|
||||
+5568
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-private-apis'), 'version' => 'c5843b6c5e84b352f43b');
|
||||
@@ -0,0 +1,26 @@
|
||||
var on=Object.create;var $o=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var ct=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var cn=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of nn(o))!an.call(t,n)&&n!==e&&$o(t,n,{get:()=>o[n],enumerable:!(r=rn(o,n))||r.enumerable});return t};var x=(t,o,e)=>(e=t!=null?on(sn(t)):{},cn(o||!t||!t.__esModule?$o(e,"default",{value:t,enumerable:!0}):e,t));var K=ct((Vi,lr)=>{lr.exports=window.ReactJSXRuntime});var B=ct((Wi,fr)=>{fr.exports=window.React});var pr=ct(dr=>{"use strict";var Vt=B();function Jn(t,o){return t===o&&(t!==0||1/t===1/o)||t!==t&&o!==o}var Xn=typeof Object.is=="function"?Object.is:Jn,Zn=Vt.useState,Qn=Vt.useEffect,ts=Vt.useLayoutEffect,es=Vt.useDebugValue;function os(t,o){var e=o(),r=Zn({inst:{value:e,getSnapshot:o}}),n=r[0].inst,s=r[1];return ts(function(){n.value=e,n.getSnapshot=o,fo(n)&&s({inst:n})},[t,e,o]),Qn(function(){return fo(n)&&s({inst:n}),t(function(){fo(n)&&s({inst:n})})},[t]),es(e),e}function fo(t){var o=t.getSnapshot;t=t.value;try{var e=o();return!Xn(t,e)}catch{return!0}}function rs(t,o){return o()}var ns=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rs:os;dr.useSyncExternalStore=Vt.useSyncExternalStore!==void 0?Vt.useSyncExternalStore:ns});var gr=ct((Gi,mr)=>{"use strict";mr.exports=pr()});var vr=ct(Rr=>{"use strict";var Me=B(),ss=gr();function is(t,o){return t===o&&(t!==0||1/t===1/o)||t!==t&&o!==o}var as=typeof Object.is=="function"?Object.is:is,cs=ss.useSyncExternalStore,us=Me.useRef,ls=Me.useEffect,fs=Me.useMemo,hs=Me.useDebugValue;Rr.useSyncExternalStoreWithSelector=function(t,o,e,r,n){var s=us(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=fs(function(){function a(d){if(!f){if(f=!0,u=d,d=r(d),n!==void 0&&i.hasValue){var p=i.value;if(n(p,d))return l=p}return l=d}if(p=l,as(u,d))return p;var m=r(d);return n!==void 0&&n(p,m)?(u=d,p):(u=d,l=m)}var f=!1,u,l,h=e===void 0?null:e;return[function(){return a(o())},h===null?void 0:function(){return a(h())}]},[o,e,r,n]);var c=cs(t,s[0],s[1]);return ls(function(){i.hasValue=!0,i.value=c},[c]),hs(c),c}});var Sr=ct((Yi,yr)=>{"use strict";yr.exports=vr()});var Tr=ct((Pa,br)=>{br.exports=window.ReactDOM});var Hr=ct((Tu,jr)=>{jr.exports=window.wp.privateApis});var ge=new WeakMap,Bo=new WeakMap,Gt={current:[]},ze=!1,Kt=0,Ht=new Set,me=new Map;function Do(t){for(let o of t){if(Gt.current.includes(o))continue;Gt.current.push(o),o.recompute();let e=Bo.get(o);if(e)for(let r of e){let n=ge.get(r);n?.length&&Do(n)}}}function un(t){let o={prevVal:t.prevState,currentVal:t.state};for(let e of t.listeners)e(o)}function ln(t){let o={prevVal:t.prevState,currentVal:t.state};for(let e of t.listeners)e(o)}function Re(t){if(Kt>0&&!me.has(t)&&me.set(t,t.prevState),Ht.add(t),!(Kt>0)&&!ze)try{for(ze=!0;Ht.size>0;){let o=Array.from(Ht);Ht.clear();for(let e of o){let r=me.get(e)??e.prevState;e.prevState=r,un(e)}for(let e of o){let r=ge.get(e);r&&(Gt.current.push(e),Do(r))}for(let e of o){let r=ge.get(e);if(r)for(let n of r)ln(n)}}}finally{ze=!1,Gt.current=[],me.clear()}}function ut(t){Kt++;try{t()}finally{if(Kt--,Kt===0){let o=Ht.values().next().value;o&&Re(o)}}}function Uo(t){return typeof t=="function"}var qt=class{constructor(o,e){this.listeners=new Set,this.subscribe=r=>{var n,s;this.listeners.add(r);let i=(s=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:s.call(n,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,r,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):Uo(o)?this.state=o(this.prevState):this.state=o,(n=(r=this.options)==null?void 0:r.onUpdate)==null||n.call(r),Re(this)}};var lt="__TSR_index",Vo="popstate",Wo="beforeunload";function jo(t){let o=t.getLocation(),e=new Set,r=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?r(i):o=t.getLocation()},s=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}let u=t.getBlockers?.()??[],l=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&l)for(let h of u){let d=St(a.path,a.state);if(await h.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{let f=o.state[lt];c=zo(f+1,c),s({task:()=>{t.pushState(i,c),r({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{let f=o.state[lt];c=zo(f,c),s({task:()=>{t.replaceState(i,c),r({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{s({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{s({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BALine truncated
|
||||
`)+";$_TSR.c()"}}):null}function Vr(){let t=E();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;let e=(t.options.getScrollRestorationKey||Zt)(t.latestLocation),r=e!==Zt(t.latestLocation)?e:void 0,n={storageKey:Nt,shouldScrollRestoration:!0};return r&&(n.key=r),(0,Ur.jsx)(Dr,{children:`(${_e.toString()})(${JSON.stringify(n)})`})}var $e=W.memo(function({matchId:o}){let e=E(),r=C({select:v=>{let w=v.matches.find(S=>S.id===o);return z(w,`Could not find match for matchId "${o}". Please file an issue!`),{routeId:w.routeId,ssr:w.ssr,_displayPending:w._displayPending}},structuralSharing:!0}),n=e.routesById[r.routeId],s=n.options.pendingComponent??e.options.defaultPendingComponent,i=s?(0,T.jsx)(s,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,f=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",l=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??s??(n.options.errorComponent?.preload||u))?W.Suspense:Rt,h=c?Dt:Rt,d=f?Nr:Rt,p=C({select:v=>v.loadedAt}),m=C({select:v=>{let w=v.matches.findIndex(S=>S.id===o);return v.matches[w-1]?.routeId}}),R=n.isRoot?n.options.shellComponent??Rt:Rt;return(0,T.jsxs)(R,{children:[(0,T.jsx)(Ct.Provider,{value:o,children:(0,T.jsx)(l,{fallback:i,children:(0,T.jsx)(h,{getResetKey:()=>p,errorComponent:c||Ut,onCatch:(v,w)=>{if($(v))throw v;at(!1,`Error in route match: ${o}`),a?.(v,w)},children:(0,T.jsx)(d,{fallback:v=>{if(!f||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!n.isRoot)throw v;return W.createElement(f,v)},children:u||r._displayPending?(0,T.jsx)(hr,{fallback:i,children:(0,T.jsx)(Wr,{matchId:o})}):(0,T.jsx)(Wr,{matchId:o})})})})}),m===O&&e.options.scrollRestoration?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ss,{}),(0,T.jsx)(Vr,{})]}):null]})});function Ss(){let t=E(),o=W.useRef(void 0);return(0,T.jsx)("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...tt(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}var Wr=W.memo(function({matchId:o}){let e=E(),{match:r,key:n,routeId:s}=C({select:a=>{let f=a.matches.find(p=>p.id===o),u=f.routeId,h=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:h?JSON.stringify(h):void 0,routeId:u,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),i=e.routesById[s],c=W.useMemo(()=>{let a=i.options.component??e.options.defaultComponent;return a?(0,T.jsx)(a,{},n):(0,T.jsx)(Be,{})},[n,i.options.component,e.options.defaultComponent]);if(r._displayPending)throw e.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw e.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){let a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){let f=e.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!e.isServer){let u=X();f._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),f._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return z($(r.error),"Expected a notFound error"),wo(e,i,r.error);if(r.status==="redirected")throw z(V(r.error),"Expected a redirect error"),e.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(e.isServer){let a=(i.options.errorComponent??e.options.defaultErrorComponent)||Ut;return(0,T.jsx)(a,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return c}),Be=W.memo(function(){let o=E(),e=W.useContext(Ct),r=C({select:f=>f.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[r],s=C({select:f=>{let l=f.matches.find(h=>h.id===e);return z(l,`Could not find parent match for matchId "${e}"`),l.globalNotFound}}),i=C({select:f=>{let u=f.matches,l=u.findIndex(h=>h.id===e);return u[l+1]?.id}}),c=o.options.defaultPendingComponent?(0,T.jsx)(o.options.defaultPendingComponent,{}):null;if(s)return wo(o,n,void 0);if(!i)return null;let a=(0,T.jsx)($e,{matchId:i});return e===O?(0,T.jsx)(W.Suspense,{fallback:c,children:a}):a});function xo(){let t=E(),e=t.routesById[O].options.pendingComponent??t.options.defaultPendingComponent,r=e?(0,ot.jsx)(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?Rt:De.Suspense,s=(0,ot.jsxs)(n,{fallback:r,children:[!t.isServer&&(0,ot.jsx)(Ar,{}),(0,ot.jsx)(Ps,{})]});return t.options.InnerWrap?(0,ot.jsx)(t.options.InnerWrap,{children:s}):s}function Ps(){let t=E(),o=C({select:n=>n.matches[0]?.id}),e=C({select:n=>n.loadedAt}),r=o?(0,ot.jsx)($e,{matchId:o}):null;return(0,ot.jsx)(Ct.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?r:(0,ot.jsx)(Dt,{getResetKey:()=>e,errorComponent:Ut,onCatch:n=>
Line truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
|
||||
(**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
|
||||
(**
|
||||
* @license React
|
||||
* use-sync-external-store-shim/with-selector.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
+3531
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-primitives', 'wp-private-apis'), 'module_dependencies' => array(array('id' => '@wordpress/abilities', 'import' => 'static')), 'version' => '13556bc597bbf2a8d620');
|
||||
@@ -0,0 +1,45 @@
|
||||
var Wa=Object.create;var vr=Object.defineProperty;var Ba=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var $a=Object.getPrototypeOf,Ua=Object.prototype.hasOwnProperty;var te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ha=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Va(t))!Ua.call(e,a)&&a!==r&&vr(e,a,{get:()=>t[a],enumerable:!(o=Ba(t,a))||o.enumerable});return e};var m=(e,t,r)=>(r=e!=null?Wa($a(e)):{},Ha(t||!e||!e.__esModule?vr(r,"default",{value:e,enumerable:!0}):r,e));var je=te((vl,hr)=>{hr.exports=window.wp.element});var b=te((gl,br)=>{br.exports=window.React});var U=te((bl,xr)=>{xr.exports=window.ReactJSXRuntime});var ue=te((Dl,Or)=>{Or.exports=window.ReactDOM});var Ea=te((af,ba)=>{ba.exports=window.wp.data});var xa=te((nf,Sa)=>{Sa.exports=window.wp.i18n});var _a=te((lf,Ca)=>{Ca.exports=window.wp.components});var Pa=te((sf,ka)=>{ka.exports=window.wp.keyboardShortcuts});var Da=te((ff,Oa)=>{Oa.exports=window.wp.primitives});var Ia=te((gf,Na)=>{Na.exports=window.wp.privateApis});var pt=m(je(),1);var gr=1,za=.9,Ka=.8,Ga=.17,yt=.1,Rt=.999,qa=.9999,Ya=.99,Xa=/[\\\/_+.#"@\[\(\{&]/,Za=/[\\\/_+.#"@\[\(\{&]/g,Ja=/[\s-]/,yr=/[\s-]/g;function bt(e,t,r,o,a,n,l){if(n===t.length)return a===e.length?gr:Ya;var i=`${a},${n}`;if(l[i]!==void 0)return l[i];for(var u=o.charAt(n),s=r.indexOf(u,a),f=0,c,g,w,C;s>=0;)c=bt(e,t,r,o,s+1,n+1,l),c>f&&(s===a?c*=gr:Xa.test(e.charAt(s-1))?(c*=Ka,w=e.slice(a,s-1).match(Za),w&&a>0&&(c*=Math.pow(Rt,w.length))):Ja.test(e.charAt(s-1))?(c*=za,C=e.slice(a,s-1).match(yr),C&&a>0&&(c*=Math.pow(Rt,C.length))):(c*=Ga,a>0&&(c*=Math.pow(Rt,s-a))),e.charAt(s)!==t.charAt(n)&&(c*=qa)),(c<yt&&r.charAt(s-1)===o.charAt(n+1)||o.charAt(n+1)===o.charAt(n)&&r.charAt(s-1)!==o.charAt(n))&&(g=bt(e,t,r,o,s+1,n+2,l),g*yt>c&&(c=g*yt)),c>f&&(f=c),s=r.indexOf(u,s+1);return l[i]=f,f}function wr(e){return e.toLowerCase().replace(yr," ")}function Rr(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,bt(e,t,wr(e),wr(t),0,0,{})}var N=m(b(),1);var wl=!!(typeof window<"u"&&window.document&&window.document.createElement);function ye(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}var Sr=m(b(),1);function Er(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Et(...e){return t=>{let r=!1,o=e.map(a=>{let n=Er(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){let n=o[a];typeof n=="function"?n():Er(e[a],null)}}}}function We(...e){return Sr.useCallback(Et(...e),e)}var Z=m(b(),1),St=m(U(),1);function Cr(e,t){let r=Z.createContext(t),o=n=>{let{children:l,...i}=n,u=Z.useMemo(()=>i,Object.values(i));return(0,St.jsx)(r.Provider,{value:u,children:l})};o.displayName=e+"Provider";function a(n){let l=Z.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function _r(e,t=[]){let r=[];function o(n,l){let i=Z.createContext(l),u=r.length;r=[...r,l];let s=c=>{let{scope:g,children:w,...C}=c,v=g?.[e]?.[u]||i,p=Z.useMemo(()=>C,Object.values(C));return(0,St.jsx)(v.Provider,{value:p,children:w})};s.displayName=n+"Provider";function f(c,g){let w=g?.[e]?.[u]||i,C=Z.useContext(w);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[s,f]}let a=()=>{let n=r.map(l=>Z.createContext(l));return function(i){let u=i?.[e]||n;return Z.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return a.scopeName=e,[o,Qa(a,...t)]}function Qa(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){let l=o.reduce((i,{useScope:u,scopeName:s})=>{let c=u(n)[`__scope${s}`];return{...i,...c}},{});return Z.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var xt=m(b(),1);var kr=m(b(),1),Be=globalThis?.document?kr.useLayoutEffect:()=>{};var en=xt[" useId ".trim().toString()]||(()=>{}),tn=0;function Ve(e){let[t,r]=xt.useState(en());return Be(()=>{e||r(o=>o??String(tn++))},[e]),e||(t?`radix-${t}`:"")}var J=m(b(),1);var $e=m(b(),1);var rn=J[" useInsertionEffect ".trim().toString()]||Be;function Pr({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){let[a,n,l]=on({defaultProp:t,onChange:r}),i=e!==void 0,u=i?e:a;{let f=J.useRef(e!==void 0);J.useEffect(()=>{let c=f.current;c!==i&&console.warn(`${o} is changing from ${c?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}let s=J.useCallback(f=>{if(i){let c=an(f)?f(e):f;c!==e&&l.current?.(c)}else n(f)},[i,e,n,l]);return[u,s]}function on({defaultProp:e,onChange:t}){let[r,o]=J.useState(e),a=J.useRef(r),n=J.useRef(t);return rn(()=>{n.current=t},[t]),J.useEffect(()=>{a.current!==r&&(n.current?.(r),a.current=r)},[r,a]),[r,o,n]}functioLine truncated
|
||||
.`.concat(Wt,` {
|
||||
overflow: hidden `).concat(o,`;
|
||||
padding-right: `).concat(i,"px ").concat(o,`;
|
||||
}
|
||||
body[`).concat(Se,`] {
|
||||
overflow: hidden `).concat(o,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
|
||||
padding-left: `.concat(a,`px;
|
||||
padding-top: `).concat(n,`px;
|
||||
padding-right: `).concat(l,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(i,"px ").concat(o,`;
|
||||
`),r==="padding"&&"padding-right: ".concat(i,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(fe,` {
|
||||
right: `).concat(i,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(ce,` {
|
||||
margin-right: `).concat(i,"px ").concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(fe," .").concat(fe,` {
|
||||
right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
.`).concat(ce," .").concat(ce,` {
|
||||
margin-right: 0 `).concat(o,`;
|
||||
}
|
||||
|
||||
body[`).concat(Se,`] {
|
||||
`).concat(Bt,": ").concat(i,`px;
|
||||
}
|
||||
`)},Io=function(){var e=parseInt(document.body.getAttribute(Se)||"0",10);return isFinite(e)?e:0},ui=function(){xe.useEffect(function(){return document.body.setAttribute(Se,(Io()+1).toString()),function(){var e=Io()-1;e<=0?document.body.removeAttribute(Se):document.body.setAttribute(Se,e.toString())}},[])},Yt=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;ui();var n=xe.useMemo(function(){return qt(a)},[a]);return xe.createElement(li,{styles:si(n,!t,a,r?"":"!important")})};var Xt=!1;if(typeof window<"u")try{Te=Object.defineProperty({},"passive",{get:function(){return Xt=!0,!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{Xt=!1}var Te,de=Xt?{passive:!1}:!1;var fi=function(e){return e.tagName==="TEXTAREA"},Ao=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!fi(e)&&r[t]==="visible")},ci=function(e){return Ao(e,"overflowY")},di=function(e){return Ao(e,"overflowX")},Zt=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=To(e,o);if(a){var n=Lo(e,o),l=n[1],i=n[2];if(l>i)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},mi=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},pi=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},To=function(e,t){return e==="v"?ci(t):di(t)},Lo=function(e,t){return e==="v"?mi(t):pi(t)},vi=function(e,t){return e==="h"&&t==="rtl"?-1:1},Mo=function(e,t,r,o,a){var n=vi(e,window.getComputedStyle(t).direction),l=n*o,i=r.target,u=t.contains(i),s=!1,f=l>0,c=0,g=0;do{if(!i)break;var w=Lo(e,i),C=w[0],v=w[1],p=w[2],E=v-p-n*C;(C||E)&&To(e,i)&&(c+=E,g+=C);var k=i.parentNode;i=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(f&&(a&&Math.abs(c)<1||!a&&l>c)||!f&&(a&&Math.abs(g)<1||!a&&-l>g))&&(s=!0),s};var tt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fo=function(e){return[e.deltaX,e.deltaY]},jo=function(e){return e&&"current"in e?e.current:e},hi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gi=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},wi=0,Ce=[];function Wo(e){var t=I.useRef([]),r=I.useRef([0,0]),o=I.useRef(),a=I.useState(wi++)[0],n=I.useState(Ae)[0],l=I.useRef(e);I.useEffect(function(){l.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=So([e.lockRef.current],(e.shards||[]).map(jo),!0).filter(Boolean);return v.forEach(function(p){return p.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(p){return p.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=I.useCallback(function(v,p){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var E=tt(v),k=r.current,T="deltaX"in v?v.deltaX:k[0]-E[0],L="deltaY"in v?v.deltaY:k[1]-E[1],P,x=v.target,R=Math.abs(T)>Math.abs(L)?"h":"v";if("touches"in v&&R==="h"&&x.type==="range")return!1;var z=Zt(R,x);if(!z)return!0;if(z?P=R:(P=R==="v"?"h":"v",z=Zt(R,x)),!z)return!1;if(!o.current&&"changedTouches"in v&&(T||L)&&(o.current=P),!P)return!0;var ne=o.current||P;return Mo(ne,p,v,ne==="h"?T:L,!0)},[]),u=I.useCallback(function(v){var p=v;if(!(!Ce.length||Ce[Ce.length-1]!==n)){var E="deltaY"in p?Fo(p):tt(p),k=t.current.filter(function(P){return P.name===p.type&&(P.target===p.target||p.target===P.shadowParent)&&hi(P.delta,E)})[0];if(k&&k.should){p.cancelable&&p.preventDefault();return}if(!k){var T=(l.current.shards||[]).map(jo).filter(Boolean).filter(function(P){return P.contains(p.target)}),L=T.length>0?i(p,T[0]):!l.current.noIsolation;L&&p.cancelable&&p.preventDefault()}}},[]),s=I.useCallback(function(v,p,E,k){var T={name:v,delta:p,target:E,should:k,shadowParent:yi(E)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(L){return L!==T})},1)},[]),f=I.useCallback(function(v){r.current=tt(v),o.current=void 0},[]),c=I.useCallback(function(v){s(v.type,Fo(v),v.target,i(v,e.lockRef.current))},[]),g=I.useCallback(function(v){s(v.type,tt(v),v.target,i(v,e.lockRef.current))},[]);I.useEffect(function(){return Ce.push(n),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:g}),document.addEventListener("wheel",u,de),document.addEventListener("touchmove",u,de),document.addEventListener("touchstart",f,de),function(){Ce=Ce.filter(function(v){return v!==n}),document.removeEventListener("wheel",u,de),document.removeEventListener("touchmove",u,de),document.removeEventListener("touchstart",f,de)}},[]);var w=e.removeScrollBar,C=e.inert;return I.createElement(I.Fragment,null,C?I.createElement(n,{styles:gi(a)}):null,w?I.createElement(Yt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Bo=Ut(et,Wo);var Vo=rt.forwardRef(function(e,t){return rt.createElement(Ie,Y({},e,{ref:t,sideCar:Bo}))});Vo.classNames=Ie.classNames;var Jt=Vo;var Ri=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_e=new WeakMap,ot=new WeakMap,at={},Qt=0,$o=function(e){return e&&(e.host||$o(e.parentNode))},bi=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=$o(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ei=function(e,t,r,o){var a=bi(t,Array.isArray(e)?e:[e]);at[r]||(at[r]=new WeakMap);var n=at[r],l=[],i=new Set,u=new Set(a),s=function(c){!c||i.has(c)||(i.add(c),s(c.parentNode))};a.forEach(s);var f=function(c){!c||u.has(c)||Array.prototype.forEach.call(c.children,function(g){if(i.has(g))f(g);else try{var w=g.getAttribute(o),C=w!==null&&w!=="false",v=(_e.get(g)||0)+1,p=(n.get(g)||0)+1;_e.set(g,v),n.set(g,p),l.push(g),v===1&&C&&ot.set(g,!0),p===1&&g.setAttribute(r,"true"),C||g.setAttribute(o,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return f(t),i.clear(),Qt++,function(){l.forEach(function(c){var g=_e.get(c)-1,w=n.get(c)-1;_e.set(c,g),n.set(c,w),g||(ot.has(c)||c.removeAttribute(o),ot.delete(c)),w||c.removeAttribute(r)}),Qt--,Qt||(_e=new WeakMap,_e=new WeakMap,ot=new WeakMap,at={})}},Uo=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=t||Ri(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),Ei(o,a,r,"aria-hidden")):function(){return null}};var O=m(U(),1),it="Dialog",[Ho,Uu]=_r(it),[Si,ee]=Ho(it),zo=e=>{let{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:l=!0}=e,i=N.useRef(null),u=N.useRef(null),[s,f]=Pr({prop:o,defaultProp:a??!1,onChange:n,caller:it});return(0,O.jsx)(Si,{scope:t,triggerRef:i,contentRef:u,contentId:Ve(),titleId:Ve(),descriptionId:Ve(),open:s,onOpenChange:f,onOpenToggle:N.useCallback(()=>f(c=>!c),[f]),modal:l,children:r})};zo.displayName=it;var Ko="DialogTrigger",xi=N.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=ee(Ko,r),n=We(t,a.triggerR
Line truncated
|
||||
|
||||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Ti="DialogDescriptionWarning",Li=({contentRef:e,descriptionId:t})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ta(Ti).contentName}}.`;return N.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},ra=zo;var oa=qo,aa=Yo,na=Xo;var h=m(b(),1);var ua=m(b(),1),zi=m(ue(),1);var j=m(b(),1);var Fi=m(b(),1);function ia(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function le(...e){return t=>{let r=!1,o=e.map(a=>{let n=ia(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){let n=o[a];typeof n=="function"?n():ia(e[a],null)}}}}var lt=m(U(),1),ji=Symbol.for("react.lazy"),st=j[" use ".trim().toString()];function Wi(e){return typeof e=="object"&&e!==null&&"then"in e}function la(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ji&&"_payload"in e&&Wi(e._payload)}function sa(e){let t=Bi(e),r=j.forwardRef((o,a)=>{let{children:n,...l}=o;la(n)&&typeof st=="function"&&(n=st(n._payload));let i=j.Children.toArray(n),u=i.find($i);if(u){let s=u.props.children,f=i.map(c=>c===u?j.Children.count(s)>1?j.Children.only(null):j.isValidElement(s)?s.props.children:null:c);return(0,lt.jsx)(t,{...l,ref:a,children:j.isValidElement(s)?j.cloneElement(s,void 0,f):null})}return(0,lt.jsx)(t,{...l,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function Bi(e){let t=j.forwardRef((r,o)=>{let{children:a,...n}=r;if(la(a)&&typeof st=="function"&&(a=st(a._payload)),j.isValidElement(a)){let l=Hi(a),i=Ui(n,a.props);return a.type!==j.Fragment&&(i.ref=o?le(o,l):l),j.cloneElement(a,i)}return j.Children.count(a)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vi=Symbol("radix.slottable");function $i(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vi}function Ui(e,t){let r={...t};for(let o in t){let a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...i)=>{let u=n(...i);return a(...i),u}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function Hi(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var fa=m(U(),1),Ki=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ae=Ki.reduce((e,t)=>{let r=sa(`Primitive.${t}`),o=ua.forwardRef((a,n)=>{let{asChild:l,...i}=a,u=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,fa.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var or=m(b(),1);var ca=m(b(),1),da=globalThis?.document?ca.useLayoutEffect:()=>{};var Gi=or[" useId ".trim().toString()]||(()=>{}),qi=0;function pe(e){let[t,r]=or.useState(Gi());return da(()=>{e||r(o=>o??String(qi++))},[e]),e||(t?`radix-${t}`:"")}var Le='[cmdk-group=""]',ar='[cmdk-group-items=""]',Yi='[cmdk-group-heading=""]',pa='[cmdk-item=""]',ma=`${pa}:not([aria-disabled="true"])`,nr="cmdk-item-select",ke="data-value",Xi=(e,t,r)=>Rr(e,t,r),va=h.createContext(void 0),Me=()=>h.useContext(va),ha=h.createContext(void 0),ir=()=>h.useContext(ha),ga=h.createContext(void 0),wa=h.forwardRef((e,t)=>{let r=Pe(()=>{var d,S;return{search:"",value:(S=(d=e.value)!=null?d:e.defaultValue)!=null?S:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Pe(()=>new Set),a=Pe(()=>new Map),n=Pe(()=>new Map),l=Pe(()=>new Set),i=ya(e),{label:u,children:s,value:f,onValueChange:c,filter:g,shouldFilter:w,loop:C,disablePointerSelection:v=!1,vimBindings:p=!0,...E}=e,k=pe(),T=pe(),L=pe(),P=h.useRef(null),x=ll();ve(()=>{if(f!==void 0){let d=f.trim();r.current.value=d,R.emit()}},[f]),ve(()=>{x(6,fr)},[]);let R=h.useMemo(()=>({subscribe:d=>(l.current.add(d),()=>l.current.delete(d)),snapshot:()=>r.current,setState:(d,S,_)=>{var y,D,M,X;if(!Object.is(r.current[d],S)){if(r.current[d]=S,d==="search")ht(),se(),x(1,vt);else if(d==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(L);K?K.focus():(y=document.getElementById(k))==null||y.focus()}if(x(7,()=>{var K;r.current.selectedItemId=(K=we())==null?void 0:K.id,R.emit()}),_||x(5,fr),((D=i.current)==null?void 0:D.value)!==void 0){let K=S??"";(X=(M=i.current).onValueChange)==null||X.call(M,K);return}}R.emit()}},emit:()=>{l.current.forEach(d=>d())}}),[]),z=h.useMemo(()=>({value:(d,S,_)=>{var y;S!==((y=n.current.get(d))==null?void 0:y.value)&&(n.current.set(d,{value:S,keywords:_}),r.current.filtered.items.set(d,ne(S,_)),x(2,()=>{se(),R.emit()}))},item:(d,S)=>(o.current.add(d),
Line truncated
|
||||
Reference in new issue
Block a user